curl "https://api.getagentdrive.com/v0/files?drive_id=drv_abc123&prefix=documents/&delimiter=/&limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"data": [
{
"id": "file_xyz789",
"drive_id": "drv_abc123",
"path": "documents/report.pdf",
"filename": "report.pdf",
"mime_type": "application/pdf",
"size": 24576,
"content_hash": "sha256:abcdef1234567890",
"content_preview": null,
"tags": ["report"],
"metadata": {},
"created_at": "2026-01-15T10:30:00Z",
"updated_at": "2026-01-15T10:30:00Z"
}
],
"folders": ["documents/images/", "documents/drafts/"],
"total": 1,
"page": 1,
"limit": 20
}
Files
List Files
List files in a drive with optional folder navigation and pagination.
GET
/
v0
/
files
curl "https://api.getagentdrive.com/v0/files?drive_id=drv_abc123&prefix=documents/&delimiter=/&limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"data": [
{
"id": "file_xyz789",
"drive_id": "drv_abc123",
"path": "documents/report.pdf",
"filename": "report.pdf",
"mime_type": "application/pdf",
"size": 24576,
"content_hash": "sha256:abcdef1234567890",
"content_preview": null,
"tags": ["report"],
"metadata": {},
"created_at": "2026-01-15T10:30:00Z",
"updated_at": "2026-01-15T10:30:00Z"
}
],
"folders": ["documents/images/", "documents/drafts/"],
"total": 1,
"page": 1,
"limit": 20
}
Query Parameters
string
required
The ID of the drive to list files from.
string
Filter files by path prefix. Use this for folder-based navigation (e.g.,
documents/).string
A delimiter for grouping files into folders. Typically
/.integer
The page number for pagination. Defaults to 1.
integer
The number of files per page. Defaults to 50.
curl "https://api.getagentdrive.com/v0/files?drive_id=drv_abc123&prefix=documents/&delimiter=/&limit=20" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"data": [
{
"id": "file_xyz789",
"drive_id": "drv_abc123",
"path": "documents/report.pdf",
"filename": "report.pdf",
"mime_type": "application/pdf",
"size": 24576,
"content_hash": "sha256:abcdef1234567890",
"content_preview": null,
"tags": ["report"],
"metadata": {},
"created_at": "2026-01-15T10:30:00Z",
"updated_at": "2026-01-15T10:30:00Z"
}
],
"folders": ["documents/images/", "documents/drafts/"],
"total": 1,
"page": 1,
"limit": 20
}
Response
object[]
An array of file records matching the query.
string[]
An array of folder prefixes found at the current level. Only present when a
delimiter is specified.integer
The total number of files matching the query.
integer
The current page number.
integer
The number of files per page.
