Document Type Types
Type definitions for Document Type in the DocuTray Python SDK — request and response models, fields, and enums.
Types for document type operations.
DocumentType
A document type definition.
Fields:
-
boundingBoxesEnabled:bool | None- Whether extraction also returns per-field locations (field_locations). -
codeType:str- Unique document type code. -
conversionMode:ConversionMode | str | None- Conversion mode used by the OCR pipeline. Unknown modes are kept as plain strings. -
conversionSpec:dict[str, Any] | None- Spec that maps extracted JSON to CSV/Excel columns on tray export. -
createdAt:datetime | None- Creation timestamp. -
description:str | None- Document type description. -
dslRules:str | None- Saved DSL validation rules, orNonewhen no rules are configured. -
id:str- Unique document type ID. -
identifyPromptHints:str | None- Hints for the document identification prompt. -
isDraft:bool- Indicates if the document type is a draft. -
isPublic:bool- Indicates if the document type is public. -
jsonSchema:dict[str, Any] | None- JSON Schema for the document type (returned byGET /api/document-types/{id}). -
keepPropertyOrdering:bool | None- Whether property ordering in the schema is preserved. -
model_config:Any -
name:str- Document type name. -
promptHints:str | None- Hints for the OCR extraction prompt. -
status:str | None- Document type status. -
updatedAt:datetime | None- Last update timestamp.
ValidationErrorInfo
Validation error information.
Fields:
-
count:int- Total number of errors found. -
messages:list[str]- List of descriptive error messages. -
model_config:Any
ValidationResult
Result of validating JSON data against a document type.
Validation runs the document type's JSON Schema and its DSL rules.
valid and issues carry the structured result; errors and
warnings keep the summarized count/messages format.
Fields:
-
errors:ValidationErrorInfo- Validation errors summary. -
issues:list[ValidationIssue]- Structured errors followed by warnings. -
model_config:Any -
valid:bool | None- Whether the data conforms (warnings do not make it invalid). -
warnings:ValidationWarningInfo- Validation warnings summary.
ValidationWarningInfo
Validation warning information.
Fields:
-
count:int- Total number of warnings found. -
messages:list[str]- List of descriptive warning messages. -
model_config:Any