Limai Docs
API ReferenceClassification

Classifier Settings

Turn label creation on or off for a classifier.

PATCH/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

NameTypeInRequiredDescription
classifierIdstringpathYesThe classifier ID.
allowNewLabelsbooleanbodyYestrue 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

Response200
{
  "classifierId": "clf_123abc",
  "allowNewLabels": false
}

Errors

StatusWhen
400allowNewLabels is missing or not a boolean
403You cannot edit this classifier
404The 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.

On this page