Labels
List and create the labels a classifier uses to name document types.
A label names a document type, such as "Invoice" or "Purchase Order". Each classifier keeps its own set.
- Every route has a label named after it, and a routed document carries its route's label. Renaming the route renames its label.
- A document that matches no route still gets a label: an existing one when it fits, or a new one the classifier creates. The status
UNCLASSIFIEDtherefore means classified but not routed, and the label says what the document is. - The classifier sees the current labels every time it runs, so it reuses them instead of inventing synonyms. Labels can be renamed, merged and archived in the app.
The classifier creates labels only while its allowNewLabels setting is on (the default) and it has fewer than 200 active labels outside its routes. At 50 it sends a CLASSIFIER_LABEL_LIMIT_REACHED notice; at 200 it stops creating labels until some are merged or archived.
List Labels
/api/v1/classify/{classifierId}/labels| Name | Type | In | Required | Description |
|---|---|---|---|---|
classifierId | string | path | Yes | The classifier ID. |
includeArchived | boolean | query | No | Pass true to include archived labels. Defaults to false. |
const response = await fetch(
`https://app.limai.io/api/v1/classify/${CLASSIFIER_ID}/labels`,
{ headers: { "Authorization": `Bearer ${API_TOKEN}` } }
)
const { labels } = await response.json(){
"labels": [
{
"id": "lbl_invoice01",
"name": "Invoice",
"description": null,
"routeId": "route_123abc",
"classificationCount": 412,
"archivedAt": null,
"createdAt": "2026-11-10T09:00:00.000Z",
"updatedAt": "2026-11-10T09:00:00.000Z"
},
{
"id": "lbl_po01",
"name": "Purchase Order",
"description": "Buyer-issued order listing goods, quantities and prices",
"routeId": null,
"classificationCount": 37,
"archivedAt": null,
"createdAt": "2026-11-11T14:20:00.000Z",
"updatedAt": "2026-11-11T14:20:00.000Z"
}
]
}Labels are sorted by classificationCount, highest first, then by name. Labels merged into another label are never listed.
| Field | Type | Description |
|---|---|---|
id | string | Label ID. Pass it as label to GET /classifications. |
name | string | Display name |
description | string | null | One-line description. The classifier reads it when choosing a label. |
routeId | string | null | The route this label belongs to, or null for a label outside the routes |
classificationCount | number | How many classifications carry this label |
archivedAt | ISO 8601 | null | When the label was archived. Archived labels are not offered to the classifier. |
createdAt | ISO 8601 | When the label was created |
updatedAt | ISO 8601 | When the label last changed |
Create a Label
/api/v1/classify/{classifierId}/labelsAdd a label before the classifier meets that kind of document, so it uses your name from the first document on. Requires edit permission on the classifier. Labels you create do not fire CLASSIFIER_LABEL_CREATED; only labels the classifier creates do.
| Name | Type | In | Required | Description |
|---|---|---|---|---|
classifierId | string | path | Yes | The classifier ID. |
name | string | body | Yes | Label name, 1 to 100 characters. Use the full, singular name of the document type, e.g. Purchase Order. |
description | string | null | body | No | One-line description the classifier reads when choosing a label. |
const response = await fetch(
`https://app.limai.io/api/v1/classify/${CLASSIFIER_ID}/labels`,
{
method: "POST",
headers: {
"Authorization": `Bearer ${API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
name: "Purchase Order",
description: "Buyer-issued order listing goods, quantities and prices"
})
}
)
const label = await response.json(){
"id": "lbl_po01",
"name": "Purchase Order",
"description": "Buyer-issued order listing goods, quantities and prices",
"routeId": null,
"classificationCount": 0,
"archivedAt": null,
"createdAt": "2026-11-12T08:00:00.000Z",
"updatedAt": "2026-11-12T08:00:00.000Z"
}The response is a label with the same fields as in the list.
Errors
| Status | When |
|---|---|
400 | name is missing, empty, or longer than 100 characters |
403 | You cannot edit this classifier |
404 | The classifier does not exist or is not accessible |
409 | A label with the same name already exists. Names are compared case-insensitively, ignoring punctuation and plurals, so "Purchase orders" conflicts with "Purchase Order". |