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

ParameterTypeDescription
document_idstringThe document’s UUID.

Query parameters

ParameterTypeDefaultDescription
expandstringPass 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:

FieldTypeDescription
titlestring | nullDocument title (max 1000 chars).
authorstring | nullAuthor (max 500 chars).
publication_datestring | nullPublication date.
publisherstring | nullPublisher (max 200 chars).
isbn / isbn_13string | nullISBN-10 / ISBN-13.
skustring | nullExternal identifier (max 100 chars). Not required to be unique.
languagestring | nullLanguage code.
licensestring | nullLicense.
scopestringVisibility: private, organization, or public.
categoriesstring[] | nullCategory tags.
collectionsstring[] | nullCollection ids.
urnstring | nullCanonical URN (max 500 chars; must be unique).
custom_propertiesobject | nullArbitrary 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
}
StatusMeaning
200Document deleted.
404Document not found or not accessible.
500Deletion failed (the response error.message describes the failure).