openapi: 3.0.3 info: title: 'Handwriting OCR' description: '' version: 1.0.0 servers: - url: 'https://www.handwritingocr.com' paths: /api/v1/documents: get: summary: 'List documents' operationId: listDocuments description: "Get a paginated list of the authenticated user's documents." parameters: - in: query name: page description: 'The page number. Default: 1' example: 7 required: false schema: type: integer description: 'The page number. Default: 1' example: 7 - in: query name: per_page description: 'The number of items per page. Default: 50' example: 13 required: false schema: type: integer description: 'The number of items per page. Default: 50' example: 13 responses: 200: description: '' content: application/json: schema: type: object example: current_page: 1 data: - document_id: abc123 status: processed created_at: '2023-05-01T12:00:00Z' updated_at: '2023-05-01T12:30:00Z' automatically_deleted_at: '2023-05-08T12:00:00Z' page_count: 5 original_file_name: example.pdf action: transcribe first_page_url: 'http://www.handwritingocr.com/api/v1/documents?page=1' from: 1 last_page: 1 last_page_url: 'http://www.handwritingocr.com/api/v1/documents?page=1' links: - url: null label: '« Previous' active: false - url: 'http://www.handwritingocr.com/api/v1/documents?page=1' label: '1' active: true - url: null label: 'Next »' active: false next_page_url: null path: 'http://www.handwritingocr.com/api/v1/documents' per_page: 50 prev_page_url: null to: 1 total: 1 properties: current_page: type: integer example: 1 data: type: array example: - document_id: abc123 status: processed created_at: '2023-05-01T12:00:00Z' updated_at: '2023-05-01T12:30:00Z' automatically_deleted_at: '2023-05-08T12:00:00Z' page_count: 5 original_file_name: example.pdf action: transcribe items: type: object properties: document_id: type: string example: abc123 status: type: string example: processed created_at: type: string example: '2023-05-01T12:00:00Z' updated_at: type: string example: '2023-05-01T12:30:00Z' automatically_deleted_at: type: string example: '2023-05-08T12:00:00Z' page_count: type: integer example: 5 original_file_name: type: string example: example.pdf action: type: string example: transcribe first_page_url: type: string example: 'http://www.handwritingocr.com/api/v1/documents?page=1' from: type: integer example: 1 last_page: type: integer example: 1 last_page_url: type: string example: 'http://www.handwritingocr.com/api/v1/documents?page=1' links: type: array example: - url: null label: '« Previous' active: false - url: 'http://www.handwritingocr.com/api/v1/documents?page=1' label: '1' active: true - url: null label: 'Next »' active: false items: type: object properties: url: type: string example: null label: type: string example: '« Previous' active: type: boolean example: false next_page_url: type: string example: null path: type: string example: 'http://www.handwritingocr.com/api/v1/documents' per_page: type: integer example: 50 prev_page_url: type: string example: null to: type: integer example: 1 total: type: integer example: 1 tags: - 'Document Management' post: summary: 'Process a new document' operationId: processANewDocument description: 'Upload a new document for processing.' parameters: [] responses: 201: description: '' content: application/json: schema: type: object example: document_id: abc123 status: queued properties: document_id: type: string example: abc123 status: type: string example: queued 422: description: '' content: application/json: schema: type: object example: errors: file: - 'The file field is required.' action: - 'The action field is required.' properties: errors: type: object properties: file: type: array example: - 'The file field is required.' items: type: string action: type: array example: - 'The action field is required.' items: type: string tags: - 'Document Management' requestBody: required: true content: multipart/form-data: schema: type: object properties: file: type: string format: binary description: 'The document file to upload. Must be PDF, JPG, JPEG, or PNG. Maximum file size 20MB (contact us if you need higher limits).' action: type: string description: 'The processing action. Must be one of: transcribe (for full text extraction), tables (for tables extraction), extractor (for custom extraction).' example: voluptatem extractor_id: type: integer description: 'Required if action is extractor. The ID of the custom extractor to use (see https://www.handwritingocr.com/extractors).' example: 20 delete_after: type: integer description: 'The number of seconds after which the document should be automatically deleted. Minimum: 120. If not provided, the default setting will be applied (see https://www.handwritingocr.com/profile)' example: 15 required: - file - action '/api/v1/documents/{id}': delete: summary: 'Delete a document' operationId: deleteADocument description: 'Delete a specific document and its associated file.' parameters: [] responses: 204: description: '' 404: description: '' content: application/json: schema: type: object example: message: 'No query results for model [App\Models\Document] abc123' properties: message: type: string example: 'No query results for model [App\Models\Document] abc123' tags: - 'Document Management' parameters: - in: path name: id description: "The document's id." example: occaecati required: true schema: type: string '/api/v1/documents/{id}/download/{token}/{action}.{format}': get: summary: 'Download processed document' operationId: downloadProcessedDocument description: 'Download a processed document in the specified format.' parameters: [] responses: 200: description: '' content: text/plain: schema: type: string example: "{\n \"binary_file_content\"\n}" 403: description: '' content: application/json: schema: type: object example: error: 'Invalid or expired download token' properties: error: type: string example: 'Invalid or expired download token' tags: - 'Document Management' parameters: - in: path name: id description: "The document's id." example: veritatis required: true schema: type: string - in: path name: token description: 'The download token.' example: velit required: true schema: type: string - in: path name: action description: 'The processing action. Must be one of: transcribe, tables, extractor.' example: in required: true schema: type: string - in: path name: format description: 'The download format. Available formats depend on the action.' example: reprehenderit required: true schema: type: string tags: - name: 'Document Management' description: "\nAPIs for managing documents" components: securitySchemes: default: type: http scheme: bearer description: 'You can enable API access and generate your token by visiting the settings page in the account dashboard.' security: - default: []