Skip to main content
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

drive_id
string
required
The ID of the drive to list files from.
prefix
string
Filter files by path prefix. Use this for folder-based navigation (e.g., documents/).
delimiter
string
A delimiter for grouping files into folders. Typically /.
page
integer
The page number for pagination. Defaults to 1.
limit
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

data
object[]
An array of file records matching the query.
folders
string[]
An array of folder prefixes found at the current level. Only present when a delimiter is specified.
total
integer
The total number of files matching the query.
page
integer
The current page number.
limit
integer
The number of files per page.