Documents API
Manage individual documents after they have been ingested: fetch a document and its metadata, update metadata fields, or delete a document and all of its associated data.
Authentication
All endpoints require a Bearer token. See Getting Started.
Authorization: Bearer <your-api-key>
Access is scoped to your team: a document that does not belong to your team responds with 404.
Get a document
GET /api/documents/{document_id}
Path parameters
| Parameter | Type | Description |
|---|---|---|
document_id | string | The document’s UUID. |
Query parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
expand | string | — | Pass files to include the document’s file metadata in the response. May be repeated. |
Response
{
"data": {
"id": "doc-xyz789",
"title": "Annual Report 2024",
"author": null,
"scope": "organization",
"status": "published",
"sku": "dbost",
"custom_properties": { "source_code": "dbost" },
"document_format": "PDF"
},
"error": null
}
Returns 404 if the document does not exist or is not accessible.
Update a document
Update document metadata. Only the fields included in the request body are changed.
PATCH /api/documents/{document_id}
Request body
Send any subset of the following fields:
| Field | Type | Description |
|---|---|---|
title | string | null | Document title (max 1000 chars). |
author | string | null | Author (max 500 chars). |
publication_date | string | null | Publication date. |
publisher | string | null | Publisher (max 200 chars). |
isbn / isbn_13 | string | null | ISBN-10 / ISBN-13. |
sku | string | null | External identifier (max 100 chars). Not required to be unique. |
language | string | null | Language code. |
license | string | null | License. |
scope | string | Visibility: private, organization, or public. |
categories | string[] | null | Category tags. |
collections | string[] | null | Collection ids. |
urn | string | null | Canonical URN (max 500 chars; must be unique). |
custom_properties | object | null | Arbitrary metadata, validated against the team’s custom-property definitions. |
Response
{
"data": { "id": "doc-xyz789", "title": "Annual Report 2024", "sku": "dbost" },
"error": null
}
Returns 400 for invalid fields (including a duplicate urn) and 404 if the document is not found.
Delete a document
Permanently deletes a document and all of its associated data — storage files, cover images, jobs, sections, and parts.
DELETE /api/documents/{document_id}
Response
{
"data": { "id": "doc-xyz789" },
"error": null
}
| Status | Meaning |
|---|---|
200 | Document deleted. |
404 | Document not found or not accessible. |
500 | Deletion failed (the response error.message describes the failure). |