Create Document Type
Step-by-step guide to create custom document types using the AI-powered creation wizard
This guide will help you create a custom document type using Docutray's AI-powered creation wizard.
Prerequisites
Before you begin, make sure you have:
- An active Docutray account
- At least one sample document of the type you want to create (PDF, JPG, PNG, etc.)
- A clear description of the data you want to extract from the document
Step 1: Access the Creation Wizard
-
Log in to your Docutray account at https://app.docutray.com
-
In the sidebar menu, navigate to Document Types
-
Click the New Document Type button
![]()
Step 2: Upload Sample Documents
The wizard will show you an upload zone where you can upload your sample documents.
Supported Formats
- PDF: PDF documents
- Images: JPG, PNG, GIF, BMP, WebP
Limits
- Maximum size: 10MB per file
- Maximum quantity: 5 files at a time
How to Upload
You have two options:
- Drag and drop: Drag files directly to the upload zone
- Select files: Click the upload zone to open the file selector
![]()
Tip: Upload multiple examples of the same document type to get better schema generation results.
Step 3: Describe the Data to Extract
Once at least one document is uploaded, a configuration panel with a text field will appear.
Describe the Fields
In the description field, clearly indicate what data you want to extract from the document. Be specific about:
- Field names you want to obtain
- Expected data types (text, numbers, dates, lists)
- Approximate location in the document if relevant
Description Example
Extract the following data from the invoice:
- Invoice number
- Issue date
- Issuer tax ID
- Issuer company name
- Recipient tax ID
- Net total
- Tax (e.g., VAT)
- Total amount due
- List of items with: quantity, description, unit price, and total![]()
Step 4: Generate the Schema
-
Click the Generate Schema with AI button
-
The system will analyze your documents and automatically generate:
- A JSON schema with detected fields
- A suggested name for the document type
- A description of the document type
-
While generating, you'll see progress indicators:
- Analyzing documents...
- Generating schema...
- Extracting test data...
![]()
Generation can take 10-30 seconds depending on document complexity.
Step 5: Review and Edit the Schema
Once generated, you can view and edit the schema in an interactive table.
Edit Fields
For each field you can modify:
- Name: The field identifier name
- Type: Text, Number, Boolean, Array, or Object
- Description: A field description
- Required: Whether the field is mandatory
Available Field Types
| Type | Icon | Use |
|---|---|---|
| Text | A | Text strings |
| Number | # | Numeric values |
| Boolean | Toggle | True/False |
| Array | [ ] | Arrays of values |
| Object | { } | Nested structures |
Add or Remove Fields
- Add: Use the "Add Field" button at the bottom of the table
- Remove: Use the trash icon on each row
![]()
Step 6: Test the Extraction
The system automatically runs an extraction test after generating the schema.
View Results
-
Switch to the Results tab
-
You'll see the extracted data from the sample document in structured format
-
You can toggle between tree view and JSON to review the data
If Results are Incorrect
- Go back to the Configuration tab
- Adjust the schema as needed
- Click Regenerate to test again
![]()
Step 7: Configure Metadata
Before creating the document type, configure its information:
Name (Required)
- Enter a descriptive name for the document type
- Example: "Electronic Invoice", "Fee Receipt"
Description (Optional)
- Add a description to help identify the document's purpose
Save as Draft
- Check this option if you want to save the type without activating it immediately
- Drafts are not available for API use until activated
![]()
Step 8: Create the Document Type
-
Review that all data is correct
-
Click the Create Document button in the top right corner
-
The system will save the document type and redirect you to its detail page
![]()
Congratulations! Your new document type is ready to use.
Error Handling
Common Errors
| Error | Solution |
|---|---|
| File too large | Reduce file size to under 10MB |
| Unsupported format | Use PDF, JPG, PNG, GIF, BMP, or WebP |
| Generation error | Check your connection and retry |
| Extraction error | Adjust the description and regenerate schema |
Retry Operations
If an error occurs during generation or extraction:
- An alert will appear with the error message
- Use the Retry button to re-execute the operation
- If the error persists, try with a more detailed description
Next Steps
Once your document type is created, you can:
- Use the API: Convert documents using the
/api/convertendpoint - Create Flows: Automate processing with DocFlows
- Configure Webhooks: Receive notifications when documents are processed
Keyboard Shortcuts
For faster navigation:
| Action | Shortcut |
|---|---|
| Open file selector | Enter or Space on upload zone |
| Navigate between fields | Tab |
| Expand/collapse nested fields | Enter on expand button |
User Guides
Step-by-step guides for DocuTray — create custom document types with the AI wizard, configure webhooks, and process your first documents.
Validating Extracted Data
Check the data Docutray extracts with JSON Schema and business rules written in the validation DSL — syntax, conditional and list rules, calculated totals, full examples, issue codes, and how to manage rules over REST and MCP.