π Integrations (API)
The Docflo API provides comprehensive access to document processing, analysis, and management capabilities. This REST API allows you to integrate Docflo's intelligent document processing features into your applications.
- Connect Docflo.ai with ERPs, CRMs, and other business platforms
- Fetch structured document data once it is processed
- Update dynamic fields to be shown to users within Docflo platform
- Manage API keys based on service-level permissions
π How it worksβ
- Go to the Integration section in the Docflo.ai platform.
- Create an API key with relevant permissions.
- Explore code samples to find a template that can be used as a kickstart.
- Perform a test call within our Swagger playground.
Base URLβ
https://api.docflo.ai
Authenticationβ
All API requests require authentication using two headers:
x-tenant-id: Your tenant identifierapiKey: Your API key
Example:
curl -H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key" \
"https://api.docflo.ai/docs/v1/document"
Data Typesβ
Please refer to Data Types for supported data structure.
Get Documentsβ
Retrieve a list of documents with optional filtering and pagination.
Endpoint: GET /docs/v1/document
Parameters:
type(string, optional) - Document type filterskip(string, optional) - Number of documents to skip for paginationtop(string, optional) - Number of documents to return (limit)source(string, optional) - Document source filtersearch(string, optional) - Search term for document contentstatus(string, optional) - Document status filtersortBy(string, optional) - Field to sort bysortOrder(string, optional) - Sort order (asc/desc)createdFrom(string, optional) - Filter documents created from this date (format: date-time, example: "2025-01-01")createdTo(string, optional) - Filter documents created until this date (format: date-time, example: "2025-10-01")favorite(boolean, optional) - Filter favorite documentsmyApprovals(boolean, optional) - Filter documents pending your approvalapproverId(string, optional) - Filter by approver IDincludeResults(boolean, optional) - Include processing results in response
Example Request:
curl -X GET "https://api.docflo.ai/docs/v1/document?type=invoice&top=10&skip=0" \
-H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key"
Create Documentβ
Upload and create a new document for processing.
Endpoint: POST /docs/v1/document
Request Body (multipart/form-data):
file(binary, required) - The document file to uploadtype(string, optional) - Document type classification
Example Request:
curl -X POST "https://api.docflo.ai/docs/v1/document" \
-H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key" \
-F "file=@invoice.pdf" \
-F "type=invoice"
Get Document by IDβ
Retrieve a specific document by its ID.
Endpoint: GET /docs/v1/document/byId/{documentId}
Path Parameters:
documentId(string, required) - The document ID
Example Request:
curl -X GET "https://api.docflo.ai/docs/v1/document/byId/12345" \
-H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key"
Analyze Documentβ
Analyze a document without storing it permanently in the system.
Endpoint: POST /docs/v1/document/analyze
Request Body (multipart/form-data):
type(string, required) - Document type for analysisfile(binary, required) - The document file to analyze
Example Request:
curl -X POST "https://api.docflo.ai/docs/v1/document/analyze" \
-H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key" \
-F "type=invoice" \
-F "file=@document.pdf"
Get Original Fileβ
Download the original uploaded file.
Endpoint: GET /docs/v1/document/download/{id}/original
Path Parameters:
id(string, required) - The document ID
Example Request:
curl -X GET "https://api.docflo.ai/docs/v1/document/download/12345/original" \
-H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key" \
--output original-document.pdf
Get Original Emailβ
If document is extracted from a mailbox, it allows retrieving the original email in EML format.
Endpoint: GET /docs/v1/document/download/{id}/email
Path Parameters:
id(string, required) - The document ID
Example Request:
curl -X GET "https://api.docflo.ai/docs/v1/document/download/12345/email" \
-H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key" \
--output original-email.eml
Update Model Fieldsβ
Update document configurations in terms (customer fields).
Endpoint: PATCH /docs/v1/fields
Query Params :
documentType(string, required) - Document typename(string, required) - Field name
Request Body (JSON):
type(string, required) - Field data type; see Supported Data Types for available optionsvisible(boolean, optional) - Field visibilityextractionMethod(string, optional) - Extraction methodextractionSettings(object, optional) - Extraction configuration settingsfields(array of strings, optional) - Field names array
Example Request:
curl -X PATCH "https://api.lab.docflo.ai/docs/types/invoice/field/YourFieldName" \
-H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"type": "currency",
"visible": true,
"extractionMethod": "ai"
}'
Update Document Fieldsβ
Update multiple fields in a document's data. This endpoint allows you to update complex nested objects and arrays with create, update, and delete operations.
Endpoint: PATCH /docs/v1/document/fields/{id}
Path Parameters:
id(string, required) - The document ID
Request Body (JSON):
fields(object, required) - Object containing the fields to update with their new values
Array Operations:
For array elements, you can specify operations using the operation field:
create- Add a new item to the arrayupdate- Update an existing item (requires_id)delete- Remove an item from the array (requires_id)
Example Request:
curl -X PATCH "https://api.docflo.ai/docs/v1/document/fields/12345" \
-H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"fields": {
"InvoiceId": "12345",
"InvoiceTotal": {
"Amount": 12345,
"CurrencyCode": "USD"
},
"Items": [
{
"operation": "create",
"Description": "API Item 3",
"amount": {
"amount": 12345,
"currencyCode": "USD"
}
},
{
"operation": "update",
"_id": "item-1",
"Description": "API Item 1",
"amount": {
"amount": 234,
"currencyCode": "ILS"
}
},
{
"operation": "delete",
"_id": "68befa1fe9a9f9a3327627c9"
}
]
}
}'
Note: This endpoint validates field keys against the document type schema to ensure data consistency.
Update Document Statusβ
Update the status of a document.
Endpoint: PATCH /docs/v1/document/info/{id}
Path Parameters:
id(string, required) - The document ID
Request Body (JSON):
status(string, required) - New document status
Example Request:
curl -X PATCH "https://api.docflo.ai/docs/v1/document/info/12345" \
-H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key" \
-H "Content-Type: application/json" \
-d '{"status": "APPROVED"}'
Document Status Valuesβ
Documents can have the following status values:
CONFIRMED- Document has been confirmed and validatedREQUIRES_VALIDATION- Document requires manual validationPROCESSING- Document is currently being processedANALYZING- Document is being analyzed by AIANALYZED- Document analysis has been completedAPPROVED- Document has been approvedFAILED- Document processing has failed
Get Document Informationβ
Retrieve detailed information about a specific document.
Endpoint: GET /docs/v1/document/info/{id}
Path Parameters:
id(string, required) - The document ID
Example Request:
curl -X GET "https://api.docflo.ai/docs/v1/document/info/12345" \
-H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key"
Get Enabled Document Typesβ
Retrieve all enabled document types in your system.
Endpoint: GET /docs/v1/types/enabled
Example Request:
curl -X GET "https://api.docflo.ai/docs/v1/types/enabled" \
-H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key"
Get Document Type Configurationβ
Retrieve configuration for a specific document type.
Endpoint: GET /docs/v1/types/{type}
Path Parameters:
type(string, required) - Document type name
Example Request:
curl -X GET "https://api.docflo.ai/docs/v1/types/invoice" \
-H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key"
AI-Powered Featuresβ
AI Document Searchβ
Search through documents using AI-powered semantic search.
Endpoint: POST /docs/v1/document/ai/search
Request Body (JSON):
model_ids(string, optional) - Comma-separated document types to search (e.g., "invoice,receipt")query(string, required) - Search queryscore_threshold(number, required) - Minimum similarity score threshold
Example Request:
curl -X POST "https://api.docflo.ai/docs/v1/document/ai/search" \
-H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"query": "Find all invoices from Microsoft",
"score_threshold": 0.7,
"model_ids": "invoice,receipt"
}'
AI Assistantβ
Use the AI assistant to ask questions about your documents.
Endpoint: POST /docs/v1/document/ai/ask
Request Body (JSON):
query(string, required) - Question to ask the AI assistanttypes(array of strings, optional) - Document types to search within
Example Request:
curl -X POST "https://api.docflo.ai/docs/v1/document/ai/ask" \
-H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"query": "What is the total amount of all invoices this month?",
"types": ["invoice"]
}'
Logging APIβ
Get Logsβ
Retrieve system logs with optional filtering.
Endpoint: GET /logs/v1/log
Parameters:
type(string, optional) - Log type filterarea(string, optional) - System area filtersubArea(string, optional) - Sub-area filtermessage(string, optional) - Message content filtermetadata(object, optional) - Additional metadata filters
Example Request:
curl -X GET "https://api.docflo.ai/logs/v1/log?type=error&area=document-processing" \
-H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key"
Authentication APIβ
Create Guest Tokenβ
Generate a guest token for temporary access.
Endpoint: POST /auth/v1/guest-token
Example Request:
curl -X POST "https://api.docflo.ai/auth/v1/guest-token" \
-H "x-tenant-id: your-tenant-id" \
-H "apiKey: your-api-key"
Document Typesβ
The following document types are supported:
invoice- Standard business invoicesreceipt- Purchase receiptscontract- Legal contracts and agreementspayStub- Employee pay stubsunclassified- Documents without specific classificationcarLicense- Vehicle license documentsidDocument- Identity documentscheck- Bank checksbankStatement- Bank account statementscreditCard- Credit card statementsincoInvoice4- Specific invoice formatpurchaseOrder- Purchase order documentsfinancialReportIL- Israeli financial reportsbankStatement.us- US bank statementsfreightInvoice- Freight and shipping invoicescreditCardStatement- Credit card account statementsgoodsReceipt- Goods receipt documentsdeliveryInvoice- Delivery invoices
Error Handlingβ
The API returns standard HTTP status codes:
200- Success201- Created400- Bad Request401- Unauthorized403- Forbidden404- Not Found500- Internal Server Error
Error responses include details about what went wrong:
{
"error": {
"code": "INVALID_DOCUMENT_TYPE",
"message": "The specified document type is not supported",
"details": "Supported types: invoice, receipt, contract..."
}
}
Rate Limitsβ
API requests are subject to rate limiting to ensure fair usage:
- Standard accounts: 1000 requests per hour
- Premium accounts: 5000 requests per hour
- Enterprise accounts: Custom limits
Rate limit information is returned in response headers:
X-RateLimit-Limit- Your rate limit ceilingX-RateLimit-Remaining- Number of requests remainingX-RateLimit-Reset- UTC epoch seconds when the rate limit resets
Best Practicesβ
- Authentication: Store API credentials securely and rotate them regularly
- Error Handling: Implement retry logic for transient failures
- Rate Limiting: Implement backoff strategies when hitting rate limits
- File Uploads: Use appropriate timeouts for large file uploads
- Pagination: Use skip/top parameters for efficient data retrieval
- Filtering: Use specific filters to reduce response sizes and improve performance