Skip to content
KATAXE | Capture

Coming soon to Mexico. Sign-up is not open there yet; this page is provided for information.

Developers · API v1

Connect KATAXE™ | Capture to your software

A REST API over HTTPS, in JSON, for your integrations: upload documents, follow them through review and publication, read bank transactions and receive events as they happen. Every request follows the same rules as the Capture interface: permissions, isolation by organization and audit log.

Version 1 is stable: it only ever changes in compatible ways.

What you can build

What your integration needs, nothing more

The v1 surface is deliberately small and stable. Each operation requires an explicit scope.

Upload documents

Send invoices and receipts from your own software, one file per call (PDF, JPEG or PNG). AI reads them exactly like documents dropped off in Capture.

Track review and publication

List documents, read their extracted fields and checks, then approve, reject or publish them to the connected accounting software, with optimistic concurrency control.

Bank accounts and transactions

Read bank, card and loan accounts and their transactions, with their matching status. Account numbers are never returned: only their last 4 digits.

Statement imports

Import OFX, QFX or CSV statements into an existing account. Matching with your documents follows automatically.

Exports

Request a ZIP archive of the documents received during a period (original files and CSV data), then download it once it is ready.

Webhooks

Receive signed events when a document is received, approved, published or rejected, instead of polling the API.

Quickstart

Your first integration in 5 steps

The examples use curl and Node.js 20 or later (built-in fetch). The keys and identifiers shown are fictitious.

  1. Create an API key

    In Capture, open Settings › API & integrations and create a key with only the scopes your integration needs (see Scopes). The key is shown once: store it right away in your secret manager. Creating and revoking keys is reserved for members allowed to manage the API (administrators, by default).

    A key starts with ktx_live_ in production and with ktx_test_ everywhere else. A test key never works in production, and vice versa.

  2. Make your first call

    GET /api/v1/organisation only requires a valid key. It confirms that authentication works and returns your organization's name, language, currency and access status (never a price or an amount), along with its deposit policy: maximum file size, accepted types and upload rate.

    curl · GET /api/v1/organisation
    # Your test key, kept out of your code (secret manager or environment variable)
    export AXETRACT_API_KEY='ktx_test_…'
    
    curl -s https://app.kataxe.com/api/v1/organisation \
      -H "Authorization: Bearer $AXETRACT_API_KEY"
    Node.js · GET /api/v1/organisation
    // Node.js 20 or later: fetch, FormData and Blob are built in
    const BASE = "https://app.kataxe.com/api/v1";
    const headers = { Authorization: `Bearer ${process.env.AXETRACT_API_KEY}` };
    
    const res = await fetch(`${BASE}/organisation`, { headers });
    if (!res.ok) {
      const problem = await res.json(); // RFC 9457
      throw new Error(`${problem.status} ${problem.code}`);
    }
    console.log(await res.json());
    Response · 200 OK
    {
      "id": "tnt_…",
      "name": "Example Company Ltd.",
      "locale": "en-MX",
      "currency": "MXN",
      "plan": {
        "status": "ACTIF",
        "trialEndsAt": null,
        "access": { "read": true, "write": true, "reason": "ACTIF", "readOnlyUntil": null }
      },
      "deposit": {
        "maxBytes": 10420224,
        "acceptedContentTypes": ["application/pdf", "image/jpeg", "image/png"],
        "acceptedExtensions": ["pdf", "jpg", "jpeg", "png"],
        "rate": { "perHour": 60, "perDay": 400 }
      },
      "…": "…"
    }
  3. Upload a document

    Send one file per call as multipart/form-data, in the file field, with the pieces:write scope. Every POST requires an Idempotency-Key header: generate one per operation and reuse it when you retry, so a network retry never creates a duplicate. Read the maximum size and the accepted types from deposit in GET /api/v1/organisation: never hard-code them.

    curl · POST /api/v1/pieces
    # One key per operation: reuse the same value if you retry
    IDEMPOTENCY_KEY=$(uuidgen)
    
    curl -si https://app.kataxe.com/api/v1/pieces \
      -H "Authorization: Bearer $AXETRACT_API_KEY" \
      -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
      -F "file=@invoice-1042.pdf"
    
    # HTTP/1.1 201 Created
    # Location: /api/v1/pieces/cm9x1k2j30000abcd1234efgh
    # {"id":"cm9x1k2j30000abcd1234efgh","version":1,"status":"RECUE","channel":"API",…}
    Node.js · POST /api/v1/pieces
    import { readFile } from "node:fs/promises";
    import { randomUUID } from "node:crypto";
    
    // BASE and headers as defined in step 2
    // One key per operation: reuse the same value if you retry
    const idempotencyKey = randomUUID();
    
    const form = new FormData();
    const pdf = new Blob([await readFile("invoice-1042.pdf")], { type: "application/pdf" });
    form.append("file", pdf, "invoice-1042.pdf");
    
    const res = await fetch(`${BASE}/pieces`, {
      method: "POST",
      headers: { ...headers, "Idempotency-Key": idempotencyKey },
      body: form,
    });
    const piece = await res.json(); // 201 Created → { id, version, status: "RECUE", … }
  4. Read it again without wasting requests

    Each versioned resource returns a strong ETag. Send it back in If-None-Match: if nothing has changed, the API answers 304 Not Modified with no body. Requires pieces:read.

    curl · GET /api/v1/pieces/{id}
    curl -si https://app.kataxe.com/api/v1/pieces/cm9x1k2j30000abcd1234efgh \
      -H "Authorization: Bearer $AXETRACT_API_KEY"
    # HTTP/1.1 200 OK
    # ETag: "3-pN0mQ8dV2r4xY7aB"
    
    curl -si https://app.kataxe.com/api/v1/pieces/cm9x1k2j30000abcd1234efgh \
      -H "Authorization: Bearer $AXETRACT_API_KEY" \
      -H 'If-None-Match: "3-pN0mQ8dV2r4xY7aB"'
    # HTTP/1.1 304 Not Modified
    Node.js · GET /api/v1/pieces/{id}
    // BASE and headers as defined in step 2
    const cache = new Map(); // id → { etag, piece }
    
    async function getPiece(id) {
      const known = cache.get(id);
      const res = await fetch(`${BASE}/pieces/${id}`, {
        headers: known ? { ...headers, "If-None-Match": known.etag } : headers,
      });
      if (res.status === 304) return known.piece; // unchanged since the last read
      if (!res.ok) throw new Error(`${res.status} ${(await res.json()).code}`);
      const piece = await res.json();
      cache.set(id, { etag: res.headers.get("ETag"), piece });
      return piece;
    }
  5. Subscribe to a webhook and verify its signature

    Create an endpoint (scopes webhooks:manage and pieces:read) and keep the whsec_… secret it returns. On your side, verify the Kataxe-Signature header against the raw request body before trusting anything else (details under Webhooks).

    curl · POST /api/v1/webhook-endpoints
    IDEMPOTENCY_KEY=$(uuidgen)
    
    curl -s -X POST https://app.kataxe.com/api/v1/webhook-endpoints \
      -H "Authorization: Bearer $AXETRACT_API_KEY" \
      -H "Idempotency-Key: $IDEMPOTENCY_KEY" \
      -H "Content-Type: application/json" \
      -d '{"url":"https://erp.example.com/axetract/webhooks","events":["piece.validee","piece.publiee"]}'
    
    # 201 Created
    # {"endpoint":{"id":"cm…","status":"ACTIF","version":1,…},"secret":"whsec_…"}
    # The secret is shown only once: store it in your secret manager
    Node.js · signature verification
    import { createHmac, timingSafeEqual } from "node:crypto";
    import { createServer } from "node:http";
    
    // Verify the signature on the raw bytes, in constant time, within 5 minutes
    function verifySignature(secret, header, rawBody, toleranceSeconds = 300) {
      const parts = String(header ?? "").split(",").map((p) => p.trim());
      const t = Number(parts.find((p) => p.startsWith("t="))?.slice(2));
      if (!Number.isInteger(t) || Math.abs(Date.now() / 1000 - t) > toleranceSeconds) return false;
      const expected = createHmac("sha256", secret).update(`${t}.`).update(rawBody).digest();
      return parts
        .filter((p) => p.startsWith("v1="))
        .some((p) => {
          const received = Buffer.from(p.slice(3), "hex");
          return received.length === expected.length && timingSafeEqual(received, expected);
        });
    }
    
    createServer((req, res) => {
      const chunks = [];
      req.on("data", (chunk) => chunks.push(chunk));
      req.on("end", () => {
        const rawBody = Buffer.concat(chunks); // raw bytes, never re-serialized JSON
        const secret = process.env.AXETRACT_WEBHOOK_SECRET; // whsec_…
        if (!verifySignature(secret, req.headers["kataxe-signature"], rawBody)) {
          res.writeHead(400).end();
          return;
        }
        res.writeHead(204).end(); // reply within 10 seconds, process afterwards
        const event = JSON.parse(rawBody.toString("utf8"));
        // At-least-once delivery: deduplicate on the Kataxe-Event-Id header
        console.log(req.headers["kataxe-event-id"], event.type, event.data);
      });
    }).listen(8080);
Authentication

One key per integration, owned by your organization

Each request carries its key in the Authorization header. Nothing else is accepted.

Authorization: Bearer ktx_<env>_<id>_<secret>. The public prefix ktx_<env>_<id> identifies the key in your list of keys. Capture never stores the secret (only its fingerprint) and cannot show it again: if it is lost, revoke the key and create a new one.

A malformed, unknown, revoked or expired key, a wrong secret or a key from another environment all receive the same 401 invalid_api_key response, which reveals nothing about the cause.

A key belongs to the organization, not to the person who created it: it keeps working after that person leaves, never takes up a seat and never receives email. Its scopes can never exceed the permissions its creator held at the time.

The API is built for servers and native apps. It offers no CORS support and refuses browser sessions (401 session_not_accepted): never put a key in a web page.

Good practice

  • Keep keys in a secret manager, never in source code or a repository. The ktx_ prefix makes a leaked key easy to detect automatically.
  • One key per integration, so you can revoke one without stopping the others.
  • Grant only the scopes the integration needs, and set an expiry date.
  • Rotate keys regularly: create the new key, switch over, then revoke the old one.

Mobile app: coming soon

The Capture mobile app will use this same API, with sign-in through your Microsoft account instead of a key.

Conventions

Predictable from one operation to the next

The same rules apply to every resource in v1.

  • Base URL: the address of your Capture application followed by /api/v1, over HTTPS only.
  • Format: JSON in UTF-8. Identifiers are opaque strings: store them, never interpret them.
  • Amounts: { "amountCents": 11498, "currency": "MXN" }, in whole cents with an explicit ISO 4217 currency. Never a floating-point number.
  • Dates: calendar dates as YYYY-MM-DD; timestamps in ISO 8601, in UTC (2026-10-26T14:03:00.000Z).
  • Status values: values such as RECUE, VALIDEE or ACTIF are stable identifiers. Compare them as codes and display your own labels.

Cursor pagination

Lists return items and nextCursor. Pass that value back as cursor (with limit, from 1 to 100, 50 by default) until nextCursor is null. There are no offsets: a cursor neither skips nor repeats an item when data changes during the walk.

Node.js · GET /api/v1/pieces?limit=100&cursor=…
// Read every document, 100 at a time, by following nextCursor
let cursor = null;
do {
  const url = new URL(`${BASE}/pieces`);
  url.searchParams.set("limit", "100");
  if (cursor) url.searchParams.set("cursor", cursor);
  const page = await (await fetch(url, { headers })).json();
  for (const piece of page.items) console.log(piece.id, piece.status);
  cursor = page.nextCursor;
} while (cursor);

Idempotency

Every POST requires Idempotency-Key (1 to 255 printable ASCII characters; a UUID works well). Within 24 hours, the same key with the same request replays the recorded response (Idempotent-Replayed: true); the same key with a different request returns 422 idempotency_key_reused. A server error is never recorded, so retrying is always safe.

Optimistic concurrency

Every change to a document (validate, reject, publish) requires If-Match with the full ETag you last read. Missing: 428 precondition_required. Out of date: 412 precondition_failed; read the resource again before deciding. The response carries the new ETag.

Rate limits

By default, each key gets 600 reads and 60 writes per minute, over a sliding window. Every authenticated response tells you where you stand; beyond the limit, the API answers 429 rate_limited with Retry-After (in seconds). Wait that long rather than retrying in a loop: refused requests count too.

Rate limit headers
RateLimit-Limit: 600
RateLimit-Remaining: 597
RateLimit-Reset: 41

HTTP/1.1 429 Too Many Requests
Retry-After: 12

Uploads are also subject to your plan's hourly and daily upload limits, shared by every channel (web, email, API): 429 deposit_rate_limited. Their values are in deposit.rate of GET /api/v1/organisation.

Scopes

Each key holds only what it needs

You choose the scopes when you create the key. An operation outside them is refused with 403 insufficient_scope, and the WWW-Authenticate header names the missing scope.

API key scopes
ScopeAllows
pieces:readList and read documents, their extracted fields, original files and suppliers.
pieces:writeUpload documents, one file per call. They count toward your plan's volume, like any other document.
pieces:reviewApprove or reject documents. On its own, only the documents uploaded with this key; together with pieces:read, all of the organization's documents.
pieces:publishPublish approved documents to the connected accounting software. On its own, only the documents uploaded with this key; together with pieces:read, all of them.
bank:readRead bank, card and loan accounts and their transactions.
bank:writeImport an OFX, QFX or CSV statement into an existing account.
exports:readTrack export requests and download archives once they are ready.
exports:writeRequest an export of the documents received during a period.
webhooks:manageCreate and manage webhook endpoints and read their delivery log. Subscribing to document events also requires pieces:read.

GET /api/v1/organisation requires no scope (a valid key is enough), and the OpenAPI contract is public.

No scope ever lets a key create or revoke keys, or manage members, roles or the accountants invited into your organization. Your subscription rules apply exactly as they do in the interface (for example, read-only access while the organization is suspended).

Errors

Standard errors, stable codes

Every error is a problem document in the RFC 9457 format (application/problem+json).

Example error (application/problem+json)
HTTP/1.1 404 Not Found
Content-Type: application/problem+json

{
  "type": "urn:kataxe:problem:not_found",
  "title": "Resource not found",
  "status": 404,
  "detail": "The requested resource was not found.",
  "code": "not_found",
  "instance": "/api/v1/pieces/cm9x1k2j30000abcd1234efgh",
  "errors": []
}
  • code is stable and listed below: your code should test it, never the text.
  • title and detail follow your Accept-Language header (English, French or Spanish; English by default).
  • errors[] gives coded details, such as { "code": "too_big", "field": "limit" } for a rejected parameter. An unexpected error returns 500 internal_error, never a technical message.
Error codes
codeHTTP statusMeaning
authentication_required401No Authorization header.
session_not_accepted401Browser session without a key: refused.
invalid_api_key401Malformed, unknown, revoked or expired key, wrong secret or key from another environment (same response in every case).
insufficient_scope403The key lacks the scope this operation requires.
forbidden403Action not allowed.
no_access, read_only, suspended403The organization's subscription does not allow this action (no access, read-only, suspended).
not_found404Does not exist, belongs to another organization or is outside what the key can see: always the same response.
invalid_request400Invalid parameter or body (see errors[]).
idempotency_key_invalid400Idempotency-Key missing on a POST, or malformed.
idempotency_in_progress409The same idempotency key is still being processed: try again shortly.
conflict409Conflicts with the resource's current state (document that cannot be changed or published, statement already imported, export already in progress).
file_scan_pending, file_blocked, file_unavailable409Original file not yet scanned, blocked as malicious, or temporarily unavailable.
precondition_failed412If-Match is out of date: read the resource again.
payload_too_large413Body or file over the limit: the applied limit, in bytes, is in errors[0].limit.
unsupported_media_type415Wrong Content-Type for the operation, or file type not accepted.
idempotency_key_reused422Same idempotency key, different request.
request_refused422Refused by a business rule (translated message).
precondition_required428If-Match missing (or *) on a change.
rate_limited429Rate limit exceeded: wait for Retry-After.
deposit_rate_limited429Your plan's upload limit has been reached (separate from the key's rate limit).
internal_error500Unexpected error.
service_unavailable503Service temporarily unavailable; nothing was recorded (Retry-After).
Webhooks

Events pushed to your systems

Capture sends a signed HTTPS request to your endpoint whenever a document's state changes, so you don't have to poll.

Manage your endpoints through the API (/api/v1/webhook-endpoints: create, update, pause, rotate the secret, test with ping, read the delivery log) or from Settings › API & integrations in Capture. An endpoint URL must use https and a public DNS name (never an IP address or a private network), with up to 10 endpoints per organization.

Event types
TypeSent when
piece.recueA document is received, whatever the channel (data.channel).
piece.valideeA document is approved.
piece.publieeA document is published to the accounting software.
piece.rejeteeA document is rejected (coded reason, never its text).
pingYou test the endpoint (never retried).

The payload holds only identifiers and codes (id, type, occurredAt, organisationId, data): no amount, file name or extracted text. Treat it as a signal and read the document through the API to get its current state. Ignore unknown types: new ones may be added within v1.

Signature

Each delivery carries Kataxe-Signature: t=<seconds>,v1=<hex>, where v1 is the HMAC-SHA256, keyed with your full whsec_… secret, of t, a dot and the raw body. Compare in constant time and reject a timestamp more than 5 minutes away from your clock (replay protection). The header may hold several v1 values: accept the request if any one of them matches.

Other headers: Kataxe-Event-Id (stable across retries), Kataxe-Event-Type and Kataxe-Delivery-Attempt. The Node.js example in step 5 implements the full check.

Delivery and retries

  • Success means any 2xx response within 10 seconds. Redirects are never followed.
  • On failure, retries follow after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h and 24 h: 9 attempts over about 3 days.
  • After the 9th failed attempt, the endpoint is taken out of service and the members who manage webhooks are notified by email. Test it with ping, then reactivate it; events from the interruption are not resent (catch up with GET /api/v1/pieces?receivedAfter=…).
  • Delivery is at least once and order is not guaranteed: deduplicate on Kataxe-Event-Id and keep processed identifiers for at least 3 days.
  • A delivery leaves 5 to 10 minutes after the event, never in real time.
Several pages

Upload a multi-page document

Several photos of one document become one document, assembled by the server. Resource /api/v1/deposit-sessions, scope pieces:write.

  1. Open: POST /api/v1/deposit-sessions with clientDepositId (a UUID v4 you generate once per document and keep until the end) and pageCount. The same clientDepositId always returns the same session and, once closed, the same document: a replay, even days later, never creates a duplicate.
  2. Send the pages: PUT /api/v1/deposit-sessions/{id}/pages/{rank}, one file per call in the file field (JPEG or PNG; a PDF only for a single-page session). Sending the same content again at the same rank has no effect.
  3. Close: POST /api/v1/deposit-sessions/{id}/close creates the document (201 and Location): a single page is uploaded as is, several pages become a PDF in rank order, then the document follows the same path as POST /api/v1/pieces.

Resume: GET /api/v1/deposit-sessions/{id} lists the pages received and missingRanks. DELETE abandons the session; an open session expires on its own (7 days by default). Pending pages are erased on close, abandonment and expiry.

Read the maximum number of pages in deposit.maxPages and the maximum document size in deposit.maxBytes of GET /api/v1/organisation: never hard-code them. Each refusal carries a code in errors[].code (for example pages_manquantes, page_differente, session_differente).

curl · Two-page session
# One session per document: keep clientDepositId until closing
CLIENT_DEPOSIT_ID=$(uuidgen | tr 'A-Z' 'a-z')

SESSION=$(curl -s https://app.kataxe.com/api/v1/deposit-sessions \
  -H "Authorization: Bearer $AXETRACT_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d "{\"clientDepositId\":\"$CLIENT_DEPOSIT_ID\",\"pageCount\":2}" | jq -r .id)

# One page per call, ranks 1 to pageCount
for RANK in 1 2; do
  curl -s -X PUT https://app.kataxe.com/api/v1/deposit-sessions/$SESSION/pages/$RANK \
    -H "Authorization: Bearer $AXETRACT_API_KEY" \
    -H "Idempotency-Key: $(uuidgen)" \
    -F "file=@receipt-page-$RANK.jpg;type=image/jpeg" > /dev/null
done

# Close: a single document, even if the call is replayed
curl -si -X POST https://app.kataxe.com/api/v1/deposit-sessions/$SESSION/close \
  -H "Authorization: Bearer $AXETRACT_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

# HTTP/1.1 201 Created
# Location: /api/v1/pieces/cm9x1k2j30000abcd1234efgh

Legal texts

GET /api/v1/legal is public (no authentication): it lists the legal texts in force (kind, version, publishedOn, language, url) in the language requested by Accept-Language. A text not yet published has publishedOn and url set to null; accept any new kind value.

# Public route: no key required
curl -s https://app.kataxe.com/api/v1/legal \
  -H "Accept-Language: fr-CA"

# {"documents":[{"kind":"conditions","version":"1.0","publishedOn":"…","language":"fr","url":"https://…"},…]}
Versioning

A stable v1, with notice before any change

The version is part of the path: /api/v1. Our commitments:

  • Within v1, only compatible changes: new fields, new error codes, new operations, new event types.
  • Never a breaking change in v1. A breaking change would ship as a new version (/api/v2), alongside v1.
  • A version is retired only at least 12 months after notice of its deprecation (Terms of Service, section 4.5), except in an emergency related to security or where required by law.
  • Write tolerant clients: ignore the fields and event types you don't know, and test codes rather than messages.
Reference

The OpenAPI contract

The complete, always up-to-date reference is the OpenAPI 3.1 contract, generated from the code itself.

Public address: https://app.kataxe.com/api/v1/openapi.json

Each operation declares its required scope (x-required-scope), its parameters, its responses and its error codes; the webhooks section describes every event. Import it into your API client or code generator.

A question about the API? Email us at support@kataxe.com.