Skip to main content
GET
/
v1
/
api
/
documents
/
{id}
Get a document
curl --request GET \
  --url https://api.hq.zone/v1/api/documents/{id} \
  --header 'Authorization: Bearer <token>'
{
  "auto_categorized": true,
  "classification_status": "<string>",
  "content_type": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "download_url": "<string>",
  "filename": "<string>",
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "is_owner": true,
  "owner_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "profile_version": "<string>",
  "reference_numbers": [
    "<string>"
  ],
  "scope": "<string>",
  "sha256": "<string>",
  "size_bytes": 123,
  "tags": [
    "<string>"
  ],
  "updated_at": "2023-11-07T05:31:56Z",
  "analysis_strategy": "<string>",
  "caption": "<string>",
  "category": "<string>",
  "channel_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "channel_name": "<string>",
  "classification_confidence": 123,
  "document_date": "2023-11-07T05:31:56Z",
  "entities": "<unknown>",
  "language": "<string>",
  "owner_display": "<string>",
  "source_ref": "<string>",
  "source_url": "<string>",
  "summary": "<string>"
}

Authorizations

Authorization
string
header
required

Personal Access Token. Send as Authorization: Bearer hq_pat_....

Path Parameters

id
string<uuid>
required

Document id

Response

Document

auto_categorized
boolean
required

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.

classification_status
string
required

pending / queued / processing / completed / failed / skipped. UI shows a pill until this hits completed.

content_type
string
required
created_at
string<date-time>
required
download_url
string
required
filename
string
required
id
string<uuid>
required
is_owner
boolean
required

True iff the caller is the document's owner. Drives "Delete / Edit" affordances in the UI.

owner_user_id
string<uuid>
required
profile_version
string
required

Schema version - hq-document-classify-v1 for legacy rows, hq-document-classify-v2 once the classifier writes back the entities + dates surface.

reference_numbers
string[]
required

Document-specific IDs (invoice/case/order numbers). Free-form.

scope
string
required
sha256
string
required
size_bytes
integer<int64>
required
tags
string[]
required
updated_at
string<date-time>
required
analysis_strategy
string | null

Which classifier pipeline produced this row (TextOnly / VisionDirect / Hybrid / Image / PassThroughText). NULL on rows from before the smart-strategy slice.

caption
string | null
category
string | null
channel_id
string<uuid> | null
channel_name
string | null
classification_confidence
number<float> | null

Self-reported model certainty (0..1) about the classification. UI flags rows below 0.6 as "needs review".

document_date
string<date-time> | null

What the doc refers to (issue / publication / statement date), not when we ingested it. NULL when not determinable.

entities
any

LLM-extracted entities ({person_names, company_names, identifiers, amounts, dates}). JSONB blob; UI renders selectively.

language
string | null

ISO 639-1 code (en, sv, ...). NULL when not determinable.

owner_display
string | null
source_ref
string | null
source_url
string | null
summary
string | null