Operations
Unified operation guides with multi-language code examples
Operations
Operations are the core building blocks of DocuTray. Each operation provides a specific document processing capability that you can use via our SDKs or REST API.
All examples below include tabs for Python, Node.js, and cURL so you can quickly get started in your preferred language.
Convert Documents
Extract structured data from documents using AI-powered OCR. Supports sync and async modes with file upload, URL, and base64 input.
Identify Documents
Automatically detect the document type from a set of candidates. Get confidence scores and use the identify-then-convert flow.
Document Types
List and inspect available document types and their JSON schemas. Validate extracted data against schemas.
Steps
Execute predefined workflow steps to process documents through configurable pipelines.
Knowledge Bases
Manage knowledge bases with semantic search, document storage, and embedding-powered retrieval.
Common Patterns
All document-processing operations (Convert, Identify, Steps) share these features:
- Sync and Async modes — Convert and Identify support both sync and async modes; Steps are async-only. Use sync for small documents and real-time responses, and async for large files or batch processing.
- Multiple input methods — Upload files directly, provide a URL, or send base64-encoded content.
- Polling with SDKs — The Python and Node.js SDKs provide built-in polling helpers (
wait()) for async operations. - Error handling — Consistent error types across all operations with typed exceptions in both SDKs.
SDK Reference
For detailed class and method documentation, see the full SDK references: