2.6 KiB
API Documentation
DocuNova provides a powerful REST API for programmatic access to all its features. This document serves as a reference for the available endpoints and their usage.
API Overview
- Base URL:
http://<your-docunova-instance>/api - Authentication: OAuth2 (when enabled)
- Response Format: JSON
Interactive API Documentation
The most up-to-date and interactive API documentation is available at:
http://<your-docunova-instance>/docs
This Swagger UI provides a complete reference with the ability to try out API calls directly from your browser.
Authentication
When authentication is enabled, you must include an authentication token in your requests:
curl -X GET "http://<your-docunova-instance>/api/files" \
-H "Authorization: Bearer <your-token>"
Common Endpoints
Document Upload
POST /api/upload
Upload one or more files for processing.
Request:
- Multipart form data with file(s)
Response:
{
"success": true,
"file_ids": [123, 124],
"message": "Files uploaded and queued for processing"
}
Get Files
GET /api/files
Retrieve a list of processed files.
Parameters:
limit(optional): Maximum number of files to returnoffset(optional): Pagination offsetsearch(optional): Search term
Response:
[
{
"id": 123,
"original_filename": "invoice.pdf",
"file_size": 1024000,
"mime_type": "application/pdf",
"created_at": "2023-04-15T12:30:45Z"
},
...
]
File Metadata
GET /api/files/{file_id}/metadata
Retrieve metadata for a specific file.
Response:
{
"document_type": "invoice",
"date": "2023-04-10",
"vendor": "Acme Corp",
"amount": "$1,234.56",
"extracted_text": "..."
}
Process Control
POST /api/files/{file_id}/reprocess
Reprocess a specific file.
Response:
{
"success": true,
"message": "File queued for reprocessing"
}
Error Handling
Errors follow standard HTTP status codes with descriptive messages:
{
"detail": "File not found",
"status_code": 404
}
Rate Limiting
The API implements rate limiting to ensure system stability. If you exceed the limits, you'll receive a 429 Too Many Requests response.
Client Libraries
For easy integration with your applications, consider using one of our client libraries:
Further Assistance
For additional help with the API, please contact our support team or refer to the Development Guide.