curl --request PATCH \
--url https://api.hq.zone/v1/api/documents/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"caption": "<string>",
"category": "<string>",
"channel_id": "<string>",
"folder_id": "<string>",
"scope": "<string>",
"tags": [
"<string>"
]
}
'import requests
url = "https://api.hq.zone/v1/api/documents/{id}"
payload = {
"caption": "<string>",
"category": "<string>",
"channel_id": "<string>",
"folder_id": "<string>",
"scope": "<string>",
"tags": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
caption: '<string>',
category: '<string>',
channel_id: '<string>',
folder_id: '<string>',
scope: '<string>',
tags: ['<string>']
})
};
fetch('https://api.hq.zone/v1/api/documents/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hq.zone/v1/api/documents/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'caption' => '<string>',
'category' => '<string>',
'channel_id' => '<string>',
'folder_id' => '<string>',
'scope' => '<string>',
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hq.zone/v1/api/documents/{id}"
payload := strings.NewReader("{\n \"caption\": \"<string>\",\n \"category\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"folder_id\": \"<string>\",\n \"scope\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.hq.zone/v1/api/documents/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"caption\": \"<string>\",\n \"category\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"folder_id\": \"<string>\",\n \"scope\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hq.zone/v1/api/documents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"caption\": \"<string>\",\n \"category\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"folder_id\": \"<string>\",\n \"scope\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"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>",
"folder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"language": "<string>",
"owner_display": "<string>",
"source_ref": "<string>",
"source_url": "<string>",
"summary": "<string>"
}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.
curl --request PATCH \
--url https://api.hq.zone/v1/api/documents/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"caption": "<string>",
"category": "<string>",
"channel_id": "<string>",
"folder_id": "<string>",
"scope": "<string>",
"tags": [
"<string>"
]
}
'import requests
url = "https://api.hq.zone/v1/api/documents/{id}"
payload = {
"caption": "<string>",
"category": "<string>",
"channel_id": "<string>",
"folder_id": "<string>",
"scope": "<string>",
"tags": ["<string>"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
caption: '<string>',
category: '<string>',
channel_id: '<string>',
folder_id: '<string>',
scope: '<string>',
tags: ['<string>']
})
};
fetch('https://api.hq.zone/v1/api/documents/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hq.zone/v1/api/documents/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'caption' => '<string>',
'category' => '<string>',
'channel_id' => '<string>',
'folder_id' => '<string>',
'scope' => '<string>',
'tags' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.hq.zone/v1/api/documents/{id}"
payload := strings.NewReader("{\n \"caption\": \"<string>\",\n \"category\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"folder_id\": \"<string>\",\n \"scope\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.hq.zone/v1/api/documents/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"caption\": \"<string>\",\n \"category\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"folder_id\": \"<string>\",\n \"scope\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hq.zone/v1/api/documents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"caption\": \"<string>\",\n \"category\": \"<string>\",\n \"channel_id\": \"<string>\",\n \"folder_id\": \"<string>\",\n \"scope\": \"<string>\",\n \"tags\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"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>",
"folder_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"language": "<string>",
"owner_display": "<string>",
"source_ref": "<string>",
"source_url": "<string>",
"summary": "<string>"
}Authorizations
Personal Access Token. Send as Authorization: Bearer hq_pat_....
Path Parameters
Document id
Body
null clears the caption, omitted keeps it.
null clears the category, omitted keeps it.
null clears the channel, omitted keeps it.
Move into a folder. null moves to the root of the document's scope;
omitted keeps it. The target folder must be visible to the caller and
share the document's (post-patch) scope - cross-scope placement is a
scope change (a share), set both together.
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.
Folder this document lives in. NULL = the root of its scope.
ISO 639-1 code (en, sv, ...). NULL when not determinable.