Create a new document type
Creates a new document type.
Non-admin users:
isPublicis forced tofalsesourceis set toUSERcodeTypemust be prefixed with the organization slug (e.g.,orgname_my_type)- At least 3 characters required after the prefix
Admin users:
- Can set
isPublictotrue sourcedefaults toADMIN- No prefix requirement on
codeType
Authorization
ApiKeyAuth Bearer token for API authentication
In: header
Request Body
application/json
Document type name
2 <= lengthUnique code identifier. Non-admin users must prefix with organization slug.
^[a-z0-9_]+$Document type description (required)
1 <= lengthJSON Schema for document validation
Whether the document type is a draft
trueHints for the OCR prompt
Hints for the document identification prompt
Conversion mode
"json""json" | "toon" | "multi_prompt"Whether to preserve property ordering in schema
falseWhether the document type is public (admin only)
Response Body
application/json
curl -X POST "https://app.docutray.com/api/document-types" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "codeType": "string", "description": "string", "jsonSchema": {} }'{
"data": {
"id": "string",
"codeType": "string",
"name": "string",
"description": "string",
"isPublic": true,
"isDraft": true,
"status": "string",
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z"
}
}Check asynchronous conversion status GET
Retrieve the current status and result of an asynchronous conversion. **Status flow:** - `ENQUEUED` → `PROCESSING` → `SUCCESS` | `ERROR` **Polling recommendations:** - Poll every 2-3 seconds for active conversions - Stop polling when status is `SUCCESS` or `ERROR` - Maximum processing time: 60 minutes (auto-timeout)
Get document type by ID GET
Retrieves details of a specific document type based on user permissions