Classify a document
classify_documentCategorize a document into one of a set of types, e.g. MSA vs SOW vs NDA (classify group), using a saved classifier or an inline list of classifications. Provide exactly one of classifier or config. Inline config.classifications must include one entry with type: "other" as the fallback and unique ids per entry. Returns the winning type with a confidence score. Creates a classify run: may return status: "running" with a runId — normal, not an error; poll it with get_classify_run. Follow any llmContext guidance included in results.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Document to classify. Exactly one of id/url/text — e.g. { "url": "https://..." } or { "id": "file_..." }, never a bare string. | |
| config | No | Inline classify config: { classifications: [{ id, type, description }], classificationRules?, advancedOptions?, parseConfig? }. Must include a type: "other" entry as the fallback; ids must be unique. Before authoring a config by hand, call get_documentation with https://docs.extend.ai/classification/configuration.md and follow it. | |
| detail | No | "concise" (default): status, output, failure fields, dashboardUrl. "full": adds config, confidence/citations, usage, timestamps. | |
| metadata | No | Arbitrary key-value metadata stored on the run. | |
| priority | No | Queue priority (1-100). | |
| classifier | No | Saved classifier to run. Provide exactly one of classifier or config. | |
| environment | Yes | "TEST" = the Test (development) environment, "PRODUCTION" = live. Must match a granted target from get_me (an API key pins one environment). | |
| waitSeconds | No | Max seconds to block waiting on the run (clamped to the server wait budget). | |
| workspaceId | Yes | Target workspace (ws_...). Must be a granted workspace — get_me lists the accepted values. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | ||
| runId | Yes | ||
| output | No | Winning classification (PROCESSED only). | |
| status | Yes | Terminal status, or "running" (resume via the get tool). | |
| runType | No | ||
| llmContext | No | ||
| dashboardUrl | No | ||
| failureReason | No | ||
| failureMessage | No |