Request Body
The ID of the drive to upload the file to.
The path where the file should be stored. Defaults to the filename if not specified.
The file content encoded as a base64 string.
The MIME type of the file. Auto-detected from the filename if not specified.
Arbitrary key-value metadata to attach to the file.
An array of string tags to associate with the file.
An ISO 8601 timestamp for when the file should expire.
curl -X POST https://api.getagentdrive.com/v0/files \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"drive_id": "drv_abc123",
"filename": "report.pdf",
"path": "documents/report.pdf",
"content": "JVBERi0xLjQK...",
"content_type": "application/pdf",
"metadata": { "author": "Jane Doe" },
"tags": ["report", "2026"]
}'
{
"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", "2026"],
"metadata": { "author": "Jane Doe" },
"created_at": "2026-01-15T10:30:00Z",
"updated_at": "2026-01-15T10:30:00Z"
}
Response
Unique identifier for the file.
The ID of the drive the file belongs to.
The full path of the file within the drive.
The MIME type of the file.
The size of the file in bytes.
A SHA-256 hash of the file content.
A text preview of the file content, if available.
Tags associated with the file.
Custom metadata attached to the file.
ISO 8601 timestamp of when the file was created.
ISO 8601 timestamp of when the file was last updated.