Documents
List documents with filtering and pagination
Authorization
bearerAuth Session JWT or OAuth2 access token
In: header
Query Parameters
Pagination cursor
Number of items per page (1-100; higher values cap at 100)
1 <= value20Response Body
application/json
application/json
curl -X GET "https://example.com/v1/documents"{ "data": [ { "id": "string", "organization_id": "string", "storage_object_id": "string", "folder_id": "string", "deleted_at": "string", "deleted_by": "string", "created_at": "string", "updated_at": "string", "file_name": "string", "file_path": "string", "content_type": "string", "size": 0, "source": "string", "title": "string", "summary": "string", "primary_attachment": { "attachable_type": "string", "attachable_id": "string", "entry_name": "string", "invoice_number": "string", "date": "string", "amount": 0, "currency": "string" } } ], "meta": { "count": 0, "next_cursor": "string" }}Create a document from a file. Requires documents:read and documents:write to verify existing files. Use source_key (assistant/) to copy from assistant bucket, or file_path (vault/) for files already in vault.
Authorization
bearerAuth Session JWT or OAuth2 access token
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/documents" \ -H "Content-Type: application/json" \ -d '{}'{ "data": { "id": "string", "organization_id": "string", "storage_object_id": "string", "folder_id": "string", "deleted_at": "string", "deleted_by": "string", "created_at": "string", "updated_at": "string", "file_name": "string", "file_path": "string", "content_type": "string", "size": 0, "source": "string", "title": "string", "summary": "string", "primary_attachment": { "attachable_type": "string", "attachable_id": "string", "entry_name": "string", "invoice_number": "string", "date": "string", "amount": 0, "currency": "string" }, "attachments": [ { "id": "string", "attachable_type": "string", "attachable_id": "string", "is_primary": true, "label": "string" } ] }}Get document counts: all is documents not in trash, trash is documents in trash
Authorization
bearerAuth Session JWT or OAuth2 access token
In: header
Response Body
application/json
application/json
curl -X GET "https://example.com/v1/documents/counts"{ "data": { "all": 0, "trash": 0 }}Get a single document by ID with attachments
Authorization
bearerAuth Session JWT or OAuth2 access token
In: header
Path Parameters
Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/v1/documents/string"{ "data": { "id": "string", "organization_id": "string", "storage_object_id": "string", "folder_id": "string", "deleted_at": "string", "deleted_by": "string", "created_at": "string", "updated_at": "string", "file_name": "string", "file_path": "string", "content_type": "string", "size": 0, "source": "string", "title": "string", "summary": "string", "primary_attachment": { "attachable_type": "string", "attachable_id": "string", "entry_name": "string", "invoice_number": "string", "date": "string", "amount": 0, "currency": "string" }, "attachments": [ { "id": "string", "attachable_type": "string", "attachable_id": "string", "is_primary": true, "label": "string" } ] }}Soft delete a document (move to trash)
Authorization
bearerAuth Session JWT or OAuth2 access token
In: header
Path Parameters
Response Body
application/json
application/json
curl -X DELETE "https://example.com/v1/documents/string"Restore a document from trash
Authorization
bearerAuth Session JWT or OAuth2 access token
In: header
Path Parameters
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/documents/string/restore"{ "data": { "id": "string", "organization_id": "string", "storage_object_id": "string", "folder_id": "string", "deleted_at": "string", "deleted_by": "string", "created_at": "string", "updated_at": "string", "file_name": "string", "file_path": "string", "content_type": "string", "size": 0, "source": "string", "title": "string", "summary": "string", "primary_attachment": { "attachable_type": "string", "attachable_id": "string", "entry_name": "string", "invoice_number": "string", "date": "string", "amount": 0, "currency": "string" }, "attachments": [ { "id": "string", "attachable_type": "string", "attachable_id": "string", "is_primary": true, "label": "string" } ] }}Permanently delete a document from trash (cannot be undone)
Authorization
bearerAuth Session JWT or OAuth2 access token
In: header
Path Parameters
Response Body
application/json
application/json
application/json
curl -X DELETE "https://example.com/v1/documents/string/permanent"