Limai Docs
API ReferenceClassification

Global Classifiers

Organization-scoped classifiers that route documents into deployments across projects.

A classifier is normally owned by a single project: it can only route documents to deployments inside that project, and it is only listed there. A global classifier is owned by the organization instead. Its routes may target deployments in any project of the organization, so one classifier can fan documents out across the whole account.

Scope is a property of the classifier itself:

ScopeprojectIdRoutes may targetListed in
Projectthe owning project IDdeployments in that project onlythe owning project
Globalnulldeployments in any project of the organizationevery project it routes into

Becoming Global

Classifiers are always created project-scoped. POST /api/v1/classify requires projectId, and there is no API parameter that creates a global classifier directly.

Turning a project classifier into a global one — and turning it back — is an explicit action in the platform, on the classifier detail page:

  • Make global requires organization-level model editing rights. The classifier keeps its existing routes, its name must be unique across the organization, and deleting the original project no longer deletes the classifier.
  • Make project-scoped is only offered when every route already targets deployments in a single project; the classifier is then owned by that project again.

Existing classifiers are unaffected until someone upgrades them.

Routes Across Projects

POST/api/v1/classify/{classifierId}/routes

Route creation is where the scope rules are enforced:

  • Project classifier — the deployment must belong to the classifier's own project. Anything else returns 400.
  • Global classifier — the deployment must belong to the same organization, and the caller must have access to that deployment's project. A caller without access to the target project gets 403.

Everything else about routes is unchanged: the deployment needs an extraction schema, and a classifier cannot have two routes to the same deployment.

const response = await fetch(
`https://app.limai.io/api/v1/classify/${CLASSIFIER_ID}/routes`,
{
  method: "POST",
  headers: {
    "Authorization": `Bearer ${API_TOKEN}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    deploymentId: "dep_other_project",
    name: "Delivery Notes",
    description: "Signed delivery notes with a shipment number"
  })
}
)

Listing Classifiers

GET/api/v1/classify

Listing is always done per project — there is no organization-wide listing endpoint. A global classifier is included in a project's list when at least one of its routes targets a deployment in that project. Visibility is derived from routes, so a global classifier with no route into a project does not appear there.

Parameters

NameTypeInRequiredDescription
projectIdstringqueryYesThe project whose classifiers to list. Returns the project's own classifiers plus every global classifier that routes into it.

Request

const response = await fetch(
`https://app.limai.io/api/v1/classify?projectId=${PROJECT_ID}`,
{ headers: { "Authorization": `Bearer ${API_TOKEN}` } }
)
const classifiers = await response.json()

Response

Response200
[
  {
    "id": "cls_global_1",
    "name": "Inbound Mail",
    "projectId": null,
    "isGlobal": true,
    "routeProjects": [
      {
        "id": "proj_finance",
        "name": "Finance"
      },
      {
        "id": "proj_logistics",
        "name": "Logistics"
      }
    ],
    "deploymentRoutes": [
      {
        "id": "route_1",
        "name": "Invoices",
        "description": "Supplier invoices",
        "deploymentId": "dep_inv",
        "deployment": {
          "id": "dep_inv",
          "name": "Invoice Processing",
          "type": "MODEL",
          "projectId": "proj_finance",
          "project": {
            "id": "proj_finance",
            "name": "Finance"
          }
        }
      }
    ],
    "classificationCount": 1284,
    "createdAt": "2026-01-04T10:00:00.000Z",
    "updatedAt": "2026-02-11T08:30:00.000Z"
  }
]
FieldTypeDescription
projectIdstring | nullThe owning project, or null for a global classifier.
isGlobalbooleantrue when projectId is null.
routeProjectsarrayDistinct projects reached by the classifier's routes. A project classifier always reports its own project.
deploymentRoutesarrayEvery route, each with the target deployment and the project that deployment belongs to.
classificationCountnumberTotal classifications performed by the classifier.

Classifying Documents

The classification endpoints are unchanged and behave identically for both scopes. Pass the classifier ID and the platform resolves the routes it is allowed to use:

For a global classifier the document can land in a deployment outside the project you started from; the response still returns the routed deploymentName and extractionSchemaId, and the extraction lives in the routed deployment's project.

Token Access

Token scopeProject classifierGlobal classifier
Organizationusable when the token's teams grant access to the owning projectusable when the token's teams grant access to at least one route project
Projectusable when the classifier belongs to the token's projectusable for classification when the classifier routes into the token's project

A project-scoped token never administers a global classifier — creating routes and changing scope require organization-level model editing rights.

CLI

limai classify list lists a project's classifiers, including the global ones routing into it, and marks each row with its scope:

limai classify list --project-id proj_finance
id             name          scope    routes  projects            classifications
cls_global_1   Inbound Mail  GLOBAL   4       Finance, Logistics  1284
cls_local_7    Contracts     PROJECT  2       Finance             96

limai classify create always creates a project-scoped classifier. limai classify add-route can target a deployment in another project when the classifier is global and you have access to that project.

On this page