Skip to content
Back to Steward

Get the latest ID-document classification job for this document

GET
/api/v1/documents/{documentId}/classification
documentId
required
string
object
status
required
string
Allowed values: PENDING PROCESSING COMPLETED FAILED
classifiedType

Classified document subtype. Null if classification was inconclusive or not yet complete.

string
Allowed values: PASSPORT DRIVING_LICENSE ID_CARD
requiresBack

Whether this document type requires a back image upload (true for driving licence and national ID)

boolean
nullable
Example
true
isGovernmentId

True iff the validator classified the document as one of the accepted subtypes (passport, driving licence, national ID). Equivalent to classifiedType !== null. Null while classification is still in flight.

boolean
nullable
invalid

True when the validator clearly identified the document as a government-issued document of a TYPE WE DO NOT ACCEPT (e.g. residence permit, work permit, birth certificate). False when accepted or when the type is unclear. Null while classification is still in flight. Drives an upload-time hard rejection (the user must re-upload).

boolean
nullable
invalidReason

Short name of the unaccepted document type, when invalid is true. Used for the rejection copy (e.g. “residence permit”). Null otherwise.

string
nullable
mismatchedFront

For back-of-ID documents (parentDocumentId set): true when the back’s classified type doesn’t match the front’s. Null for fronts or when comparison isn’t possible (front still classifying, no parent, etc.).

boolean
nullable
Example
{
"status": "PENDING",
"classifiedType": "PASSPORT",
"requiresBack": true,
"isGovernmentId": false,
"invalid": false,
"invalidReason": "string",
"mismatchedFront": false
}

Document or classification not found