Available
Tag requests
Attach your own labels to any request, such as the business it was made for, get them back on the webhook, and see spend per tag.
Updated 2026-10-13
Every engine request accepts an optional tags object: your own key/value labels for the job. Use them to record who or what a request was made for — typically the business, customer or tenant on whose behalf your system called Docparser — so that usage and spend can be broken down the way your own product is.
Tags are accepted on every endpoint: submit a document, classify an email (including the previous service’s /classify route), compare line items, violation audits, and item mapping.
Send tags
{
"documentUrl": "https://files.example.com/inv-4471.pdf",
"documentId": 4471,
"consumerRefId": "inv-4471",
"requireLineItems": true,
"webhookUrl": "/hooks/docparser",
"tags": {
"business": "acme-foods",
"businessId": 4211,
"region": "west"
}
} | Field | Type | Required | Description |
|---|---|---|---|
keys | string | Up to 20 per request | 1–64 characters of letters, digits, underscore, dot or hyphen. Case-sensitive: business and Business are different keys. |
values | string | number | boolean | — | Up to 256 characters. Numbers and booleans become strings, so 4211 and "4211" are the same value. Surrounding spaces are trimmed; an empty value is dropped. |
A request that breaks these rules — a nested object as a value, a key with a space, more than 20 keys — is rejected with 400 before a job is created. A request without tags behaves exactly as it always has.
Tags come back on the result
The webhook body, and the retrieve response, carry the request’s tags as tags:
{
"status": "processed",
"job_id": "5ca1ab1e-314d-4b2d-b9d6-8e68870b840f",
"consumer_ref_id": "inv-4471",
"tags": { "business": "acme-foods", "businessId": "4211", "region": "west" },
"...": "the endpoint's usual result fields"
} Re-submitting the same consumerRefId replaces the job, and its tags with it: the new request’s tags (or none) are what the result carries.
Analyse by tag
In the portal:
- Requests shows each request’s tags. Click one — or open
/requests?tag=business:acme-foods— to list only the requests carrying it. - System → Gemini spend → By tag groups spend by any tag key you have sent: each value’s requests, failures, share of spend and cost, and which endpoints it was spent on. Requests without that key are shown as one “not tagged” row.
Spend per tag is each job’s recorded model cost, the same figure the Requests list and dashboard show.
Choosing tags
- Use stable identifiers. A tag is grouped by exact value, so
acme-foodsandAcme Foodsare two businesses. Send an id (businessId) alongside a readable name if names can change. - Keep keys few and consistent. One key per question you want answered —
business,region,workflow— sent on every request, beats many ad-hoc keys sent sometimes. - Don’t put secrets or personal information in tags. Everyone with portal access can see them, and every webhook for the job repeats them.