Start OCR Processing
Initiate OCR processing for a document in your workspace
The OCR API is currently in closed beta.
The start OCR endpoint initiates OCR processing for a document that has been uploaded to a job in your workspace. This is an asynchronous operation that queues the document for processing and returns immediately.
You can either use an existing document in your workspace or create a new document using the Create Documents endpoint, which will return the document_id
.
After starting OCR processing, use the Get OCR Results endpoint to check the processing status and retrieve the extracted data.
Endpoint
Method | Url |
---|---|
POST | /v1.0/ocr/start |
Request Parameters
The unique identifier of the document to process. This ID is returned when you upload a document using the Create Documents endpoint. The document must already be uploaded to a job in your workspace.
Sample Request
Copied1curl -X POST 'https://api.worklayer.com/v1.0/ocr/start' \2 -H 'Authorization: Bearer {token}' \3 -H 'Content-Type: application/json' \4 -d '{5 "document_id": "95e6f305-913e-40ad-9c80-ede263670878"6 }'
Response
The response confirms that OCR processing has been initiated for the specified document.
The document ID that was submitted for OCR processing.
Sample Response
Copied1{2 "document_id": "95e6f305-913e-40ad-9c80-ede263670878"3}
Errors
Error Responses
The API returns standard HTTP status codes with descriptive error messages:
Status Code | Error Type | Description |
---|---|---|
400 | Bad Request | Invalid document ID format or missing required fields |
401 | Unauthorized | Missing or invalid bearer token |
403 | Forbidden | User lacks permission |
404 | Not Found | Document not found or workspace not found |
409 | Conflict | OCR processing already started for this document |
500 | Internal Server Error | Error starting OCR processing |