Skip to main content

REST API

A document extraction API that returns clean JSON.

Send a PDF, an image or an office file with your API key and get typed fields back, with the detected document type and a confidence score. Run it synchronously, or let DocuSense call your webhook when the document is ready.

The API is available on every plan, including the free plan (invoices and custom fields). Tax slips and pay stubs start with the Pro plan.

Building document parsing yourself takes months

  • Every vendor, employer and bank uses its own layout, and templates break at the first change.

  • An OCR alone returns text, not the fields, types and totals your application needs.

  • Uncertain results must be caught before they reach your database.

How it works

  1. Create a key

    Create an API key in the dashboard with only the permissions it needs: read, write or delete.

  2. Send the file

    POST the file as base64 JSON with documentType AUTO, or the type you expect. Batches take a ZIP or a multi-page PDF.

  3. Receive JSON

    Get the document type, a confidence score, the extracted fields, the check results and a review flag.

  4. Automate

    Use asynchronous jobs, batches and signed webhooks so your system reacts as soon as a document is processed.

Document types available through the API

The same endpoint handles every type; AUTO detects it for you.

All plans

  • Invoices
  • Custom fields on any document

Pro plan and above

  • Bank statements
  • T4, W-2, P60, P45
  • Record of Employment (ROE)
  • Canadian and European pay stubs

Ultra plan and above

  • Quebec RL-1
  • French tax notice (avis d'imposition)
  • Contracts

A response, as your code receives it

Synchronous call on an invoice (extracted data trimmed for reading).

POST /api/v1/documents
{
  "success": true,
  "data": {
    "id": "8f3c2b1e-4a5d-4c6e-9f70-1a2b3c4d5e6f",
    "status": "COMPLETED",
    "documentType": "INVOICE",
    "classificationConfidence": 0.98,
    "reviewRequired": false,
    "checkStatus": "ok",
    "extractedData": {
      "invoiceNumber": "INV-0425",
      "vendor": {
        "name": "Example Supplies Inc."
      },
      "total": 1195.74,
      "currency": "CAD"
    }
  }
}

Formats and limits

What you can send

  • PDF, PNG, JPG, WEBP, Word (.docx), Excel (.xlsx), CSV
  • One file as base64 in JSON; batches as a raw ZIP or PDF upload
  • Up to 10 MB per file; ZIP files in batches

What you get back

  • Typed JSON with document type and confidence score
  • CSV export of a document
  • Webhooks signed with HMAC-SHA256 and a timestamp

Good to know

  • Rate limits and monthly page quotas depend on your plan; every response carries the limit headers.
  • Keep your key on your server: never in a browser, a mobile app or a public repository.

Built for production

  • API keys are stored hashed, can be limited to read, write or delete, and stop working the moment you revoke them.
  • Webhooks are signed with a timestamp so your server can reject forged or replayed calls.
  • Original files are deleted once processed and identifiers such as social insurance numbers are masked.

Frequently asked questions

Is the API synchronous or asynchronous?

Both. A synchronous call returns the extracted data in the response. For long documents or batches, use asynchronous jobs and a webhook, or poll the job endpoint.

Which languages do the code samples cover?

cURL, Python, Node.js, PHP, Ruby, Go, Java, C# (.NET), VB.NET, C, C++, Kotlin, Swift, Dart, Rust and PowerShell, generated from the OpenAPI specification.

How do I know a result can be trusted?

Each response includes the detected type, a classification confidence score, the result of the automatic checks and a reviewRequired flag. Route flagged documents to a human review.

Is there an OpenAPI specification?

Yes. The full OpenAPI file is public and can be imported into Postman or any OpenAPI tool.

Can I try it for free?

Yes. The free plan includes 50 pages a month plus 100 welcome pages, and covers invoices and custom fields through the API.

Ship document extraction this week.

Create a free account, generate an API key and make your first call in minutes.