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)
Response Body
application/json
application/json
curl -X GET "https://example.com/v1/documents"{
"data": [
{
"id": "string",
"organization_id": "string",
"storage_object_id": "string",
"category": "receipt",
"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",
"primary_attachment": {
"attachable_type": "string",
"attachable_id": "string",
"entry_name": "string",
"invoice_number": "string"
}
}
],
"meta": {
"count": 0,
"next_cursor": "string"
}
}{
"error": {
"code": "string",
"message": "string",
"details": {
"property1": null,
"property2": null
}
}
}Create a document from a file. Use source_key to copy from assistant bucket, or file_path 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 '{ "category": "receipt" }'{
"data": {
"id": "string",
"organization_id": "string",
"storage_object_id": "string",
"category": "receipt",
"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",
"primary_attachment": {
"attachable_type": "string",
"attachable_id": "string",
"entry_name": "string",
"invoice_number": "string"
},
"attachments": [
{
"id": "string",
"attachable_type": "string",
"attachable_id": "string",
"is_primary": true,
"label": "string"
}
]
}
}{
"error": {
"code": "string",
"message": "string",
"details": {
"property1": null,
"property2": null
}
}
}{
"error": {
"code": "string",
"message": "string",
"details": {
"property1": null,
"property2": null
}
}
}{
"error": {
"code": "string",
"message": "string",
"details": {
"property1": null,
"property2": null
}
}
}{
"error": {
"code": "string",
"message": "string",
"details": {
"property1": null,
"property2": null
}
}
}Get document counts grouped by category
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,
"receipt": 0,
"invoice": 0,
"contract": 0,
"tax": 0,
"insurance": 0,
"legal": 0,
"report": 0,
"bank_statement": 0,
"other": 0,
"trash": 0
}
}{
"error": {
"code": "string",
"message": "string",
"details": {
"property1": null,
"property2": null
}
}
}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",
"category": "receipt",
"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",
"primary_attachment": {
"attachable_type": "string",
"attachable_id": "string",
"entry_name": "string",
"invoice_number": "string"
},
"attachments": [
{
"id": "string",
"attachable_type": "string",
"attachable_id": "string",
"is_primary": true,
"label": "string"
}
]
}
}{
"error": {
"code": "string",
"message": "string",
"details": {
"property1": null,
"property2": null
}
}
}{
"error": {
"code": "string",
"message": "string",
"details": {
"property1": null,
"property2": null
}
}
}Update document category
Authorization
bearerAuth Session JWT or OAuth2 access token
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X PATCH "https://example.com/v1/documents/string" \ -H "Content-Type: application/json" \ -d '{}'{
"data": {
"id": "string",
"organization_id": "string",
"storage_object_id": "string",
"category": "receipt",
"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",
"primary_attachment": {
"attachable_type": "string",
"attachable_id": "string",
"entry_name": "string",
"invoice_number": "string"
},
"attachments": [
{
"id": "string",
"attachable_type": "string",
"attachable_id": "string",
"is_primary": true,
"label": "string"
}
]
}
}{
"error": {
"code": "string",
"message": "string",
"details": {
"property1": null,
"property2": null
}
}
}{
"error": {
"code": "string",
"message": "string",
"details": {
"property1": null,
"property2": null
}
}
}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"{
"error": {
"code": "string",
"message": "string",
"details": {
"property1": null,
"property2": null
}
}
}{
"error": {
"code": "string",
"message": "string",
"details": {
"property1": null,
"property2": null
}
}
}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
curl -X POST "https://example.com/v1/documents/string/restore"{
"data": {
"id": "string",
"organization_id": "string",
"storage_object_id": "string",
"category": "receipt",
"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",
"primary_attachment": {
"attachable_type": "string",
"attachable_id": "string",
"entry_name": "string",
"invoice_number": "string"
},
"attachments": [
{
"id": "string",
"attachable_type": "string",
"attachable_id": "string",
"is_primary": true,
"label": "string"
}
]
}
}{
"error": {
"code": "string",
"message": "string",
"details": {
"property1": null,
"property2": null
}
}
}{
"error": {
"code": "string",
"message": "string",
"details": {
"property1": null,
"property2": null
}
}
}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
curl -X DELETE "https://example.com/v1/documents/string/permanent"{
"error": {
"code": "string",
"message": "string",
"details": {
"property1": null,
"property2": null
}
}
}{
"error": {
"code": "string",
"message": "string",
"details": {
"property1": null,
"property2": null
}
}
}