Context
Files
Each user's file storage. Upload a file in three steps (create an upload, PUT the bytes, confirm), then attach it to a task or message by id.
POST
/drive-files/uploadCreate a file upload
Returns a short-lived upload URL and the new file's id. PUT the bytes to `url` with the returned `contentType` as the `Content-Type` header, then confirm the upload.
Request body
name reqstringFile name
mimeTypestringDetected from the name when omitted
size reqintegerSize in bytes, for the quota check
folderstring | nullFolder id; omit for the root
Responses
200Upload URL
okboolean
urlstringPUT the bytes here
fileIdstring
contentTypestring
400Invalid body or storage quota exceeded
Request
curl 'https://api.agnt.ai/drive-files/upload' \
-X POST \
-H "Authorization: Bearer ak_live_..." \
-H "X-User-Email: [email protected]" \
-H "Content-Type: application/json" \
-d '{
"name": "Brightline-MSA-2026.pdf",
"size": 48213
}'Response
{
"ok": true,
"url": "https://example.com",
"fileId": "6702c804b5c6d7e8f9a0b1c2",
"contentType": "application/pdf"
}POST
/drive-files/{fileId}/confirmConfirm a file upload
Marks an uploaded file `ready` once its bytes are in place. Confirming a ready file returns it unchanged.
Path parameters
fileId reqstring
Request body
size reqintegerActual size in bytes
Responses
200File
okboolean
driveFileobject
idstringFile id; pass it as fileId in files[] on POST /tasks/{taskId}/process or POST /chats/{chatId}/process
namestring
mimeTypestring | null
sizeintegerBytes
statusenumpending until the upload is confirmed
pendingreadyfolderstring | null
createdAtstring
404No such file for this user
Request
curl 'https://api.agnt.ai/drive-files/<fileId>/confirm' \
-X POST \
-H "Authorization: Bearer ak_live_..." \
-H "X-User-Email: [email protected]" \
-H "Content-Type: application/json" \
-d '{
"size": 48213
}'Response
{
"ok": true,
"driveFile": {
"id": "6702c804b5c6d7e8f9a0b1c2",
"name": "Brightline-MSA-2026.pdf",
"mimeType": "application/pdf",
"size": 48213,
"status": "ready",
"folder": null,
"createdAt": "2026-10-10T14:30:00Z"
}
}GET
/drive-files/{fileId}Retrieve a file
Retrieves a file's details. The owner can read it, and so can people a task shares it with.
Path parameters
fileId reqstring
Responses
200File
okboolean
driveFileobject
idstringFile id; pass it as fileId in files[] on POST /tasks/{taskId}/process or POST /chats/{chatId}/process
namestring
mimeTypestring | null
sizeintegerBytes
statusenumpending until the upload is confirmed
pendingreadyfolderstring | null
createdAtstring
404Not found
Request
curl 'https://api.agnt.ai/drive-files/<fileId>' \
-H "Authorization: Bearer ak_live_..." \
-H "X-User-Email: [email protected]"Response
{
"ok": true,
"driveFile": {
"id": "6702c804b5c6d7e8f9a0b1c2",
"name": "Brightline-MSA-2026.pdf",
"mimeType": "application/pdf",
"size": 48213,
"status": "ready",
"folder": null,
"createdAt": "2026-10-10T14:30:00Z"
}
}