Identify Types
Type definitions for Identify in the DocuTray Node.js SDK — request and response models, fields, and enums.
IdentificationStatusType
Possible statuses for an identification operation.
type IdentificationStatusType = 'ENQUEUED' | 'PROCESSING' | 'SUCCESS' | 'ERROR';DocumentTypeMatch
A document type match with confidence score.
Prop
Type
IdentificationResult
Result of a synchronous identification (identify.run()): the best match in document_type and, when there are any, alternatives.
Prop
Type
IdentificationEnqueued
Response of identify.runAsync(): the identification was queued. wait() and getStatus() return the full IdentificationStatus.
Prop
Type
IdentificationStatus
Status of an asynchronous identification (identify.getStatus() and wait()). document_type, alternatives, response_timestamp and error are only sent in terminal states.
Prop
Type
IdentifyParams
Parameters for creating an identification request. Provide exactly one of file, url, or base64 as the document source. documentTypeCodeOptions is required and must have at least one code.
Prop
Type
Type Guards
isIdentificationComplete(status)
Returns true if the identification has reached a terminal state (SUCCESS or ERROR).
isIdentificationSuccess(status)
Returns true if the identification completed successfully.
isIdentificationError(status)
Returns true if the identification failed with an error.
import { isIdentificationSuccess } from 'docutray';
if (isIdentificationSuccess(status)) {
console.log('Document type:', status.document_type);
}