Ocriva Logo

Documents

API Reference

Complete REST API reference for Ocriva's document processing platform.

apireferencerest

Published: 3/31/2026

API Reference

Ocriva provides a RESTful API for integrating document processing into your applications.

Base URL

https://api.ocriva.com

Authentication

All API requests require authentication via Bearer token (JWT) or API Token.

IMPORTANT

Never expose your API tokens in client-side code, browser extensions, or public repositories. Always use server-side requests or environment variables to store tokens securely.

Using JWT

curl -X POST https://api.ocriva.com/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "user@example.com", "password": "your-password"}'

Using API Token

curl https://api.ocriva.com/upload/YOUR_ORG_ID/file \
  -H "Authorization: Bearer YOUR_API_TOKEN"

For external integrations, use your API key directly:

curl https://api.ocriva.com/v1/openapi/projects \
  -H "X-API-Key: ocr_your_api_key"

See the Open API Overview for full authentication details.

IMPORTANT

Never expose your API tokens in client-side code or public repositories. Use server-side requests and store tokens in environment variables.

Endpoints

Upload

Upload a File

POST /upload/:organizationId/file

Upload a single file for processing.

Headers:

  • Authorization: Bearer <token>
  • Content-Type: multipart/form-data

Body (form-data):

FieldTypeRequiredDescription
fileFileYesThe document file to upload
fileNamestringYesOriginal file name
fileTypestringYespdf, image, or document
projectIdstringYesTarget project ID
templateIdstringNoTemplate for processing

Response:

{
  "id": "upload_id",
  "fileName": "invoice.pdf",
  "fileUrl": "https://storage.example.com/...",
  "status": "uploaded",
  "templateId": "template_id"
}

WARNING

Individual file uploads are limited in size. Files exceeding the limit will be rejected with a 413 Payload Too Large error. For large PDFs or high-resolution images, compress or split the document before uploading.

Batch Upload

POST /batch/:organizationId/upload

Upload multiple files as a batch (max 50 files).

WARNING

Batch uploads accept a maximum of 50 files per request. The request timeout scales automatically with file count.

IMPORTANT

Batch upload is limited to 50 files per request. For larger volumes, split files into multiple batch submissions. Each file in the batch is processed independently and credits are deducted per document.

Body (form-data):

FieldTypeRequiredDescription
filesFile[]YesFiles to upload (max 50)
projectIdstringYesTarget project ID
templateIdstringNoTemplate for processing
namestringNoBatch name

TIP

Keep batches to 50 files or fewer and set a descriptive name for each batch. Very large or complex files in a single batch can approach request timeout limits — if you experience timeouts, reduce batch size or compress files before uploading.

Processing History

List Processing History

GET /processing-history?projectId=<id>&status=<status>&page=1&limit=20

Get Processing Result

GET /processing-history/:id?projectId=<id>

Templates

List Templates

GET /templates?projectId=<id>

Create Template

POST /templates

Open API

For external service integrations, Ocriva provides a dedicated Open API with direct API key authentication:

Rate Limits

API requests are subject to rate limiting based on your subscription plan.

WARNING

Exceeding rate limits will result in 429 Too Many Requests responses. Implement exponential backoff in your integration to handle these gracefully. Contact support if your use case requires higher throughput.

Error Handling

All errors follow this format:

{
  "statusCode": 400,
  "message": "Error description",
  "error": "Bad Request"
}

SDKs

Coming soon: TypeScript and Python SDKs.