API
The public Document AI API.
Submit documents over HTTP, receive structured fields with their source page, and get notified when review finishes. It is the same engine, the same queue and the same rules as the interface — without the interface.
What the API does
- PDF, JPEG and PNG up to 50 MB and 100 pages per file.
- Document type detected from the content, or declared by the sender.
- Fields with source page, normalised value and per-field status.
- Webhooks when extraction finishes, is approved, is rejected or fails.
- Asynchronous status polling, for clients that prefer not to use webhooks.
The API sends the document through the same path as the interface: OCR, type classification, field extraction, validation rules and a quality score. It is not a shortcut to the model — it is the same queue, with the same limits and the same audit log.
The result is always a review, never an approval. No API response authorises payments, and no document is treated as final until a person approves it.
Authentication
- `Authorization: Bearer arq_live_…` for production and `arq_test_…` for testing.
- Revoking does not erase: requests the key made remain auditable.
- A key without the required scope gets 403, not 401 — the key is valid, the request is not authorised.
Every request carries an organisation key in the `Authorization` header. The key is shown once, when it is created: we keep only the hash and an eight-character prefix, so it can be recognised without being revealed. Losing the key forces a rotation, and that is deliberate.
| Scope | Allows |
|---|---|
| documents:write | Submit documents |
| documents:read | Read documents and their fields |
| documents:review | Approve, reject and correct fields |
| webhooks:manage | Create, list and revoke subscriptions |
Endpoints
All paths are relative to `https://api.arquely.com/api`. That domain serves the API only: anything outside `/api/` returns 404, and the platform stays on app.arquely.com.
The full contract, in OpenAPI 3.1, is at `/v1/openapi` — public and without a key, because an integrator needs to read it before having credentials.
| Method | Path | Scope | What it does |
|---|---|---|---|
| POST | /v1/documents | documents:write | Submits a document. Requires Idempotency-Key. |
| GET | /v1/documents/{id} | documents:read | Status, family, fields and entities. |
| POST | /v1/webhooks | webhooks:manage | Creates a subscription with its own secret. |
| GET | /v1/webhooks | webhooks:manage | Lists the organisation's subscriptions. |
| GET | /v1/webhooks/{id} | webhooks:manage | One subscription in detail. |
| DELETE | /v1/webhooks/{id} | webhooks:manage | Revokes a subscription. |
| GET | /v1/webhooks/{id}/deliveries | webhooks:manage | Delivery and retry history. |
| GET | /v1/openapi | — | The contract, in OpenAPI 3.1. Public. |
Submitting a document
- The file's `Content-Type`, checked against the signature rather than the extension.
- `X-Filename` with the encoded file name.
- Optional `?family=` when the type is known: `invoice`, `identity`, `payslip`, `cheque`…
- Without `family`, the type is decided from the document content.
- 201 returns the id, status, family and processing state.
The request body is the file, not a form: bytes go from disk to private storage without being assembled in memory. `multipart/form-data` is also accepted, as a convenience, with a lower practical limit.
`Idempotency-Key` is required. Repeating the same value returns the original response instead of creating a second document; a failure releases the key so the client can fix the file and retry with the same value.
Document types
- Supplier invoice
- Identity document (ID card, passport, driving licence)
- Bank statement
- Payslip
- Proof of address (water, power, internet)
- Cheque or payment order
- Deposit or withdrawal slip
- Tax return
- Source-of-funds declaration
- Power of attorney
- Account opening form
- Sale and purchase agreement (CPCV)
- Land registry certificate or property tax record
- Balance sheet and income statement
- Guarantee or pledge contract
The platform reads fifteen document types, each with its own field schema and rules. An invoice is read by the model; a statement, a payslip or a power of attorney is read by deterministic parsers, with arithmetic verification where it exists.
Limits
Limits are enforced by the product and returned on every response in the quota headers. They are not policed by hand.
| Limit | Value |
|---|---|
| Size per file | 50 MB |
| Pages per PDF | 100 |
| Submissions per minute | 30 |
| Reads per minute | 120 |
| Reviews per minute | 30 |
| Webhook operations per minute | 10 |
Errors
Errors follow RFC 9457 (`application/problem+json`) and carry a stable `code` for the client to test against, plus a free-form `detail` that may change wording. The `request_id` follows the request into the audit log.
| Code | HTTP | What to do |
|---|---|---|
| VALIDATION_ERROR | 400 | Fix the request. |
| UNAUTHENTICATED | 401 | Send the key in «Authorization: Bearer». |
| INVALID_KEY | 401 | Check the key; it may have been rotated. |
| KEY_REVOKED | 401 | Use another key from the organisation. |
| INSUFFICIENT_SCOPE | 403 | Request a key with the required scope. |
| DOCUMENT_NOT_FOUND | 404 | Check the document id. |
| IDEMPOTENCY_IN_PROGRESS | 409 | Wait for the in-flight request to answer. |
| FAMILY_UNAVAILABLE | 409 | That type has no extractor; drop `family`. |
| LIMIT_EXCEEDED | 413 | Reduce the file or split the PDF. |
| IDEMPOTENCY_CONFLICT | 422 | The same key was used with another body; use a new one. |
| RATE_LIMITED | 429 | Wait the number of seconds in `Retry-After`. |
| SERVICE_UNAVAILABLE | 503 | Retry shortly; nothing was processed. |
Webhooks
- `document.needs_review` — extraction finished and a person is needed.
- `document.processed` — a person approved it; the document is final.
- `document.rejected` — a person rejected it, with the reason.
- `document.failed` — extraction failed for good.
Each subscription has its own secret and is signed, so the client can reject deliveries that did not come from us. Deliveries are retried with backoff and the history stays available at `/v1/webhooks/{id}/deliveries`.
Pricing
- A document is one submitted file, up to 20 pages. A 40-page file counts as two.
- No setup fee and no lock-in.
- Prices in USD, excluding VAT; the invoice is issued in meticais at the day's exchange rate.
The API has no separate price. A document submitted over HTTP consumes the same plan quota as a document uploaded through the interface — charging twice for the same work would be a strange way to build loyalty.
What you pay for is volume, metered per document processed. No charge per request, per key or per user.
| Plan | Included per month | Price | Extra document |
|---|---|---|---|
| Starter | 1,000 documents | $99 | $0.08 |
| Business | 10,000 documents | $690 | $0.03 |
| Enterprise | Above 10,000 | From $1,500 | By agreement |
