Documents

Upload document

Upload a new document for processing. Supports PDF files and

POST /api/v2/documents Try It

Upload document

cURL
curl -X POST "https://api.handwritingocr.com/v2/documents" \
     -H "Authorization: Bearer your-api-token" \
     -H "Accept: application/json" \
     -F "file=@/path/to/document.pdf" \
     -F "action=transcribe" \
     -F "delete_after=604800"
201 application/json
{
  "id": "abc123",
  "status": "queued"
}

Upload a new document for processing. Supports PDF files and various image formats. The API checks the page count of the submitted document against your credit balance before queueing for processing.

Headers

  • Authorization string required header

    Bearer your-api-token

  • Accept string required header

    application/json

  • Content-Type string required header

    multipart/form-data

Body parameters

  • action string required body

    What to do with the document. Options are transcribe, tables, extractor.

  • file file required body

    The document to process. Valid file types are PDF, JPG, PNG, TIFF, HEIC, GIF. Maximum file size is 20MB.

  • delete_after integer body

    Seconds until auto-deletion. Overrides the auto-deletion period set in your user settings.

  • extractor_id string body

    A 10-character alphanumeric string e.g. Ks08XVPyMd. Required when action is extractor.

Response codes

HTTP status
  • 201

    Document created and queued for processing.

  • 400

    Bad Request — missing required fields.

  • 401

    Unauthorized — invalid or missing API token.

  • 403

    Forbidden — insufficient page credits.

  • 415

    Unsupported Media Type.

  • 422

    Validation Error — invalid parameters.

  • 429

    Too many requests — rate limited.

  • 500

    Server Error — file storage or processing failed.