Skip to main content
POST
/
v1
/
classifications
/
{classification_id}
/
cancel
from retab import Retab

client = Retab()

classification = client.classifications.create_classification_cancel("clss_01G34H8J2K")
print(classification.status)
{
  "id": "clss_01G34H8J2K",
  "status": "cancelled",
  "error": null
}
Cancel an in-flight background Classification run (one created with background: true). Cancellation is idempotent: a run that has already reached a terminal state (completed, failed, or cancelled) is returned unchanged rather than erroring.
from retab import Retab

client = Retab()

classification = client.classifications.create_classification_cancel("clss_01G34H8J2K")
print(classification.status)
{
  "id": "clss_01G34H8J2K",
  "status": "cancelled",
  "error": null
}

Authorizations

Api-Key
string
header
required

Path Parameters

classification_id
string
required

Response

Successful Response

A classification result: the categories a document was scored against and the chosen output decision.

id
string
required

Unique identifier of the classification

file
FileRef · object
required

Information about the classified file

model
string
required

Model used for classification

categories
Category · object[]
required

Categories the document was classified against

n_consensus
integer
default:1

Number of consensus votes used

instructions
string | null

Free-form instructions supplied with the classification request.

output
ClassificationDecision · object

The classification result with reasoning. A degenerate empty decision until status == 'completed'; gate reads on status.

status
enum<string>
default:pending

Lifecycle status. The synchronous path returns 'completed'. Background runs progress pending -> queued -> in_progress -> completed | failed | cancelled.

Available options:
pending,
queued,
in_progress,
completed,
failed,
cancelled
error
PrimitiveError · object

Error details when a background run fails; null otherwise. Always present so consumers can read it without an existence check.

consensus
ClassificationConsensus · object

Consensus metadata for multi-vote classification runs

usage
RetabUsage · object

Usage information for the classification

created_at
string<date-time> | null