Classifier Settings
Turn label creation on or off for a classifier.
/api/v1/classify/{classifierId}Change a classifier's settings. Requires edit permission on the classifier.
allowNewLabels controls whether the classifier may create labels for document types it has not seen before. It is on by default. With it off, the classifier gives an unrouted document an existing label or none, so the label set stays exactly what you defined. Routing is unaffected, and routed documents still carry their route's label.
The current value is returned in each item of GET /api/v1/classify?projectId=... as allowNewLabels.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
classifierId | string | path | Yes | The classifier ID. |
allowNewLabels | boolean | body | Yes | true lets the classifier create labels; false limits it to existing labels. |
Request
const response = await fetch(
`https://app.limai.io/api/v1/classify/${CLASSIFIER_ID}`,
{
method: "PATCH",
headers: {
"Authorization": `Bearer ${API_TOKEN}`,
"Content-Type": "application/json"
},
body: JSON.stringify({ allowNewLabels: false })
}
)
const settings = await response.json()Response
{
"classifierId": "clf_123abc",
"allowNewLabels": false
}Errors
| Status | When |
|---|---|
400 | allowNewLabels is missing or not a boolean |
403 | You cannot edit this classifier |
404 | The classifier does not exist or is not accessible |
Label Limits
Independently of this setting, a classifier stops creating labels once it has 200 active labels outside its routes, and resumes when labels are merged or archived in the app. It sends CLASSIFIER_LABEL_LIMIT_REACHED at 50 active labels and again at 200.