Update a document
Updates the editable metadata of a document: its scope, channel assignment, category, tags, and caption. Only fields present in the request body are changed; for channel_id, category, and caption, an explicit null clears the value while omitting the field leaves it untouched. Only the document’s owner may modify it (others receive 403, and a missing or non-visible document returns 404). Returns the updated document. Requires the documents:write scope.
Authorizations
Personal Access Token. Send as Authorization: Bearer hq_pat_....
Path Parameters
Document id
Body
Empty string clears (revert to derived/default); absent leaves unchanged.
Empty string clears (revert to derived/default); absent leaves unchanged.
Response
Updated document
True once the classifier worker has written back the
auto-derived category/summary/tags. Distinct from category IS NOT NULL because users can set categories manually too.
pending / queued / processing / completed / failed /
skipped. UI shows a pill until this hits completed.
True iff the caller is the document's owner. Drives "Delete / Edit" affordances in the UI.
Schema version - hq-document-classify-v1 for legacy rows,
hq-document-classify-v2 once the classifier writes back
the entities + dates surface.
Document-specific IDs (invoice/case/order numbers). Free-form.
Which classifier pipeline produced this row (TextOnly / VisionDirect / Hybrid / Image / PassThroughText). NULL on rows from before the smart-strategy slice.
Self-reported model certainty (0..1) about the classification. UI flags rows below 0.6 as "needs review".
What the doc refers to (issue / publication / statement date), not when we ingested it. NULL when not determinable.
LLM-extracted entities ({person_names, company_names, identifiers, amounts, dates}). JSONB blob; UI renders selectively.
ISO 639-1 code (en, sv, ...). NULL when not determinable.