Skip to main content
PATCH
/
v0
/
files
/
{id}
curl -X PATCH https://api.getagentdrive.com/v0/files/file_xyz789 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "filename": "annual-report.pdf",
    "tags": ["report", "2026", "annual"],
    "metadata": { "author": "Jane Doe", "reviewed": true }
  }'
{
  "id": "file_xyz789",
  "drive_id": "drv_abc123",
  "path": "documents/report.pdf",
  "filename": "annual-report.pdf",
  "mime_type": "application/pdf",
  "size": 24576,
  "content_hash": "sha256:abcdef1234567890",
  "content_preview": null,
  "tags": ["report", "2026", "annual"],
  "metadata": { "author": "Jane Doe", "reviewed": true },
  "created_at": "2026-01-15T10:30:00Z",
  "updated_at": "2026-03-19T08:15:00Z"
}

Path Parameters

id
string
required
The unique identifier of the file.

Request Body

filename
string
A new filename for the file.
path
string
A new path for the file within the drive.
tags
string[]
Updated tags for the file. Replaces all existing tags.
metadata
object
Updated metadata for the file. Replaces all existing metadata.
expires_at
string
An ISO 8601 timestamp for when the file should expire. Set to null to remove expiration.
curl -X PATCH https://api.getagentdrive.com/v0/files/file_xyz789 \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "filename": "annual-report.pdf",
    "tags": ["report", "2026", "annual"],
    "metadata": { "author": "Jane Doe", "reviewed": true }
  }'
{
  "id": "file_xyz789",
  "drive_id": "drv_abc123",
  "path": "documents/report.pdf",
  "filename": "annual-report.pdf",
  "mime_type": "application/pdf",
  "size": 24576,
  "content_hash": "sha256:abcdef1234567890",
  "content_preview": null,
  "tags": ["report", "2026", "annual"],
  "metadata": { "author": "Jane Doe", "reviewed": true },
  "created_at": "2026-01-15T10:30:00Z",
  "updated_at": "2026-03-19T08:15:00Z"
}

Response

Returns the updated file record. See Get File for the full response schema.