Tags, Facets & Batch Metadata
List document tags and filter counts, add, remove or set tags on up to 1000 documents in one call, replace one document's tags, and import batch ids from CSV.
Tags are the labels your team puts on documents to sort, filter and share them. GET /v1/documents/tags lists every distinct tag on documents the key's person can see, and GET /v1/documents/system-tags lists the grouping tags Talonic sets itself, such as the email or archive a document arrived in. GET /v1/documents/facets counts visible documents per filter value, ready to drive a filter panel.
PATCH /v1/documents/batch-tag changes the tags of up to 1000 documents in one call: add merges the tags in, remove takes them away, and set replaces each document's tags. It is all or nothing: if one document is missing or hidden from the key's person, nothing changes and the call answers 404. The answer lists each document's resulting tags and the id of the one audit event the change recorded. PATCH /v1/documents/{id}/tags replaces one document's tags; an empty list clears them.
POST /v1/documents/batch-metadata/import sets batch ids on documents you already have, from a CSV. The CSV needs a document_id column and a batch_id column. document_id may be the document id, the filename without its extension, or the item id the source gave the document. Talonic answers how many documents it updated and which document_id values matched nothing.
Who can call these routes. The reads need the read scope (or documents:read), and any member of the workspace may call them. The writes need documents:write, and the key's person must be an Admin of the workspace, as in the web app; in a workspace whose model configuration Talonic manages, they return 403 insufficient_role. A tag can grant access through a tag share, so tag writes are held to the same rule as on the screen.
/v1/documents/tags/v1/documents/system-tags/v1/documents/facetsResponse fields
true) or not (false)./v1/documents/batch-tagBody parameters
add merges, remove takes the tags away, set replaces each document's tags. Default: addTag two documents
curl -X PATCH https://api.talonic.com/v1/documents/batch-tag \
-H "Authorization: Bearer $TALONIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"document_ids": ["0b6c1f9e-2d4a-4e8b-9c1d-3f5a7b9c2e10", "4e2a8c1b-7f3d-4a6e-b9c0-1d2e3f4a5b6c"], "tags": ["q3-close"], "mode": "add"}'Response (200)
{
"updated": 2,
"mode": "add",
"tags": ["q3-close"],
"results": [
{ "id": "0b6c1f9e-2d4a-4e8b-9c1d-3f5a7b9c2e10", "status": "updated", "tags": ["invoices", "q3-close"] },
{ "id": "4e2a8c1b-7f3d-4a6e-b9c0-1d2e3f4a5b6c", "status": "updated", "tags": ["q3-close"] }
],
"audit_event_id": "e7a1c2d3-4b5f-4e6a-9c8d-1f2e3a4b5c6d"
}/v1/documents/{id}/tags/v1/documents/batch-metadata/importCSV columns
Import batch ids
curl -X POST https://api.talonic.com/v1/documents/batch-metadata/import \
-H "Authorization: Bearer $TALONIC_API_KEY" \
-F "file=@batches.csv"Errors
Error responses
file, or a call made from the all-workspaces view.reason: insufficient_scope, insufficient_role, no_person, person_inactive or workspace_read_only.