API reference

Analyses

Create an analysis

POST
/v1/analyses

Starts an analysis of uploaded files. files lists the complete set of files to analyze, and spec says what to look for: a builtin template, or your own fields, checks, document types and collection requirements.

By default the request returns at once. Send Prefer: wait=<seconds> to wait up to 30 seconds for the result. The status code says whether the analysis has finished:

  • 200: the analysis succeeded, failed or was canceled.
  • 202: the analysis is still queued or running. Read it at the Location URL after Retry-After seconds, or wait for a webhook.

A live analysis is charged to the prepaid balance once, when it is created: a base price plus a price per page, per field and per check. Retries are not charged. If the balance is too low, the request returns 402 insufficient_balance and creates nothing. A failed analysis, or one canceled before work starts, is refunded.

A test key validates the request and its resolved specification, then returns a succeeded sample result at once, free of charge.

Custom document types are not supported yet. A nonempty spec.documents.custom returns 422 unsupported_candidate.

Authorization

BearerAuth
headerAuthorizationBearer <token>

A partner API key, sent as Authorization: Bearer <key>. Live keys look like sk_live_<lookup>_<secret> and test keys like sk_test_<lookup>_<secret>. A key sees only data of its own mode.

Header Parameters

x-request-id?string

Your ID for correlating this request with your logs, up to 128 bytes. If it is missing, empty or longer, the API generates one as req_<uuid>. The response echoes the ID in x-request-id, and error bodies repeat it in request_id.

Length1 <= length <= 128
Idempotency-Key*string

A unique key per create request, such as a UUID, so that a retry cannot create the resource twice.

  • A retry with the same key and input returns the original resource in its current state, without running the work again. Defaults for omitted values stay as first resolved.
  • The same key with different input returns 409 idempotency_conflict, even after the resource was deleted.
  • A retry with the same key and input after the resource was deleted or expired returns 410 resource_deleted.

Keys are scoped to the integration, the key's mode and the operation. They survive API key rotation and are removed with the integration.

Inputs match only when they are identical. An omitted member differs from one sent explicitly, even as null, and array order matters. An upload compares the file's content digest, accepted file name, media type and options. The multipart boundary, credentials, x-request-id and Prefer are ignored.

Match^[!-~]+$
Length1 <= length <= 255
Prefer?string

Waits up to 30 seconds for the analysis to finish before answering, as Prefer: wait=<seconds>. Without it, the request returns at once.

Length1 <= length

Request Body

The files to analyze and what to look for. For idempotency, the body is compared as sent, before defaults are filled in. Omitted reference_date, language and catalog version are resolved only when a new analysis is created.

application/json
  1. body

The complete set of files and what to look for in them. For collection requirements, send one analysis per person or account.

files*array<>

The IDs of the files to analyze, each listed once.

Items1 <= items
spec*|

What to look for: a builtin template, or your own fields, checks, document types and collection requirements.

reference_date?Date

The date against which document ages and periods are evaluated. It defaults to the current UTC date when the analysis is created.

Formatdate
language?Language

The language of the texts in the result. An unsupported language returns 422 unsupported_language.

Length1 <= length
Default"de"
external_id?ExternalId

Your own reference, such as a case number. It is returned unchanged, need not be unique and is never used to detect duplicates.

Length1 <= length
retention_days?RetentionDays

How many days to keep this analysis before it is deleted automatically, from 1 up to the integration's retention period. Without it, that period applies, 30 days by default. Other values, such as 0, return 422 invalid_spec. An analysis expires no later than its earliest-expiring input file.

Range1 <= value <= 90

Response Body

The analysis has finished with succeeded, failed or canceled. A failed analysis is a normal response and carries error. A retry with the same Idempotency-Key also returns 200 once the analysis has finished.

application/json
  1. response

An analysis waiting to be processed. It has no result or error yet.

id*AnalysisId

The ID of the analysis.

Match^ana_[A-Za-z0-9_-]+$
mode*Mode

Whether this is a test or a live analysis, decided by the key that created it.

Value in"test""live"
status*"queued"

queued: waiting for its files to be ready or for processing to start.

Value in"queued"
external_id?ExternalId

Your own reference, such as a case number. It is returned unchanged, need not be unique and is never used to detect duplicates.

Length1 <= length
catalog_version?CatalogVersion

The catalog version the analysis was created with. Later catalog changes do not affect it.

Length1 <= length
reference_date?Date

The date against which document ages and periods are evaluated: the date you sent, or the UTC date of creation.

Formatdate
engine_revision?EngineRevision

The version of the analysis engine that produced the result. Test analyses report test-fixtures.v<n>, and deployments with mock models report a revision starting with mock-.

Length1 <= length
expires_at?DateTime

When the analysis and its result are deleted automatically.

Formatdate-time
usage?

What the analysis processed. A completed analysis reports pages, fields and checks, also when they are zero.

curl -X POST 'https://api.aircredit.de/partner/v1/analyses' \  -H 'Idempotency-Key: 5f0c8e2a-6b1d-4c3e-9a7f-2d4b8c1e0a93' \  -H 'Content-Type: application/json' \  -d '{  "files": [    "file_8f2a",    "file_c411"  ],  "reference_date": "2026-10-07",  "language": "de",  "external_id": "loan-482",  "spec": {    "fields": {      "net_income": {        "builtin": "net_salary"      },      "employer": {        "builtin": "employer"      },      "employee_number": {        "instruction": "Personalnummer, wie auf der Gehaltsabrechnung gedruckt.",        "type": "string"      }    }  }}'
Example Response
{  "id": "ana_19c0",  "mode": "live",  "status": "succeeded",  "external_id": "loan-482",  "catalog_version": "sha256:235de54bf23a933aa613918eecfcd9e08da12d48ffdb98f80f77bda29cb5590e",  "reference_date": "2026-10-07",  "engine_revision": "api-2026.10.1",  "expires_at": "2026-11-06T10:31:04Z",  "result": {    "files": [      {        "file_id": "file_8f2a",        "pages": 2,        "readability": {          "status": "succeeded",          "readable": true        }      },      {        "file_id": "file_c411",        "pages": 6,        "readability": {          "status": "succeeded",          "readable": true        }      }    ],    "documents": [      {        "file_id": "file_8f2a",        "pages": {          "start": 1,          "end": 2        },        "period": {          "start": "2026-09",          "end": "2026-09"        },        "classification": "matched",        "document_type": {          "builtin": "gehaltsabrechnung"        },        "confidence": 0.97,        "alternatives": [],        "requirements": {}      },      {        "file_id": "file_c411",        "pages": {          "start": 1,          "end": 6        },        "period": {          "start": "2026-07",          "end": "2026-09"        },        "classification": "matched",        "document_type": {          "builtin": "kontoauszug"        },        "confidence": 0.95,        "alternatives": [],        "requirements": {}      }    ],    "fields": {      "net_income": {        "value": 3250,        "type": "money",        "currency": "EUR",        "status": "found",        "confidence": 0.95,        "citations": [          {            "file_id": "file_8f2a",            "quote": "Netto 3.250,00",            "pages": [              {                "page": 1,                "polygons": [                  [                    {                      "x": 0.612,                      "y": 0.418                    },                    {                      "x": 0.731,                      "y": 0.418                    },                    {                      "x": 0.731,                      "y": 0.436                    },                    {                      "x": 0.612,                      "y": 0.436                    }                  ]                ],                "bounding_box": {                  "left": 0.612,                  "top": 0.418,                  "width": 0.119,                  "height": 0.018                }              }            ]          }        ]      },      "employer": {        "value": "Muster GmbH",        "type": "string",        "status": "found",        "confidence": 0.99      },      "employee_number": {        "value": null,        "type": "string",        "status": "not_found"      }    },    "checks": {},    "collection": {}  },  "usage": {    "pages": 8,    "fields": 3,    "checks": 0  }}

Read an analysis

GET
/v1/analyses/{id}

Returns the analysis in its current state, with 200 in every state, including failed. Check status first. A succeeded analysis carries result and usage, and a failed one carries error.

Authorization

BearerAuth
headerAuthorizationBearer <token>

A partner API key, sent as Authorization: Bearer <key>. Live keys look like sk_live_<lookup>_<secret> and test keys like sk_test_<lookup>_<secret>. A key sees only data of its own mode.

Path Parameters

id*string

The ID of the analysis.

Match^ana_[A-Za-z0-9_-]+$

Header Parameters

x-request-id?string

Your ID for correlating this request with your logs, up to 128 bytes. If it is missing, empty or longer, the API generates one as req_<uuid>. The response echoes the ID in x-request-id, and error bodies repeat it in request_id.

Length1 <= length <= 128

Response Body

The analysis in its current state.

application/json
  1. response

An analysis waiting to be processed. It has no result or error yet.

id*AnalysisId

The ID of the analysis.

Match^ana_[A-Za-z0-9_-]+$
mode*Mode

Whether this is a test or a live analysis, decided by the key that created it.

Value in"test""live"
status*"queued"

queued: waiting for its files to be ready or for processing to start.

Value in"queued"
external_id?ExternalId

Your own reference, such as a case number. It is returned unchanged, need not be unique and is never used to detect duplicates.

Length1 <= length
catalog_version?CatalogVersion

The catalog version the analysis was created with. Later catalog changes do not affect it.

Length1 <= length
reference_date?Date

The date against which document ages and periods are evaluated: the date you sent, or the UTC date of creation.

Formatdate
engine_revision?EngineRevision

The version of the analysis engine that produced the result. Test analyses report test-fixtures.v<n>, and deployments with mock models report a revision starting with mock-.

Length1 <= length
expires_at?DateTime

When the analysis and its result are deleted automatically.

Formatdate-time
usage?

What the analysis processed. A completed analysis reports pages, fields and checks, also when they are zero.

Example Request
curl -X GET 'https://api.aircredit.de/partner/v1/analyses/ana_19c0'
Example Response
{  "id": "ana_2a77",  "mode": "live",  "status": "queued",  "catalog_version": "sha256:235de54bf23a933aa613918eecfcd9e08da12d48ffdb98f80f77bda29cb5590e",  "reference_date": "2026-10-07",  "expires_at": "2026-11-06T10:31:04Z"}

Delete an analysis

DELETE
/v1/analyses/{id}

Deletes a finished analysis and its result. The input files are kept. A queued or running analysis returns 409 analysis_in_progress, so cancel it first.

Authorization

BearerAuth
headerAuthorizationBearer <token>

A partner API key, sent as Authorization: Bearer <key>. Live keys look like sk_live_<lookup>_<secret> and test keys like sk_test_<lookup>_<secret>. A key sees only data of its own mode.

Path Parameters

id*string

The ID of the analysis.

Match^ana_[A-Za-z0-9_-]+$

Header Parameters

x-request-id?string

Your ID for correlating this request with your logs, up to 128 bytes. If it is missing, empty or longer, the API generates one as req_<uuid>. The response echoes the ID in x-request-id, and error bodies repeat it in request_id.

Length1 <= length <= 128

Response Body

The deletion was recorded. The response has no body.

Example Request
curl -X DELETE 'https://api.aircredit.de/partner/v1/analyses/ana_19c0'
Example Response
Empty

Cancel an analysis

POST
/v1/analyses/{id}/cancel

Stops a queued or running analysis. Send no body, not even an empty JSON object.

Canceling is idempotent. For an analysis that has already finished, including a canceled one, the request returns its current state and sends no further webhook event.

Authorization

BearerAuth
headerAuthorizationBearer <token>

A partner API key, sent as Authorization: Bearer <key>. Live keys look like sk_live_<lookup>_<secret> and test keys like sk_test_<lookup>_<secret>. A key sees only data of its own mode.

Path Parameters

id*string

The ID of the analysis.

Match^ana_[A-Za-z0-9_-]+$

Header Parameters

x-request-id?string

Your ID for correlating this request with your logs, up to 128 bytes. If it is missing, empty or longer, the API generates one as req_<uuid>. The response echoes the ID in x-request-id, and error bodies repeat it in request_id.

Length1 <= length <= 128

Response Body

The canceled analysis, or the final state of an analysis that had already finished.

application/json
  1. response

An analysis waiting to be processed. It has no result or error yet.

id*AnalysisId

The ID of the analysis.

Match^ana_[A-Za-z0-9_-]+$
mode*Mode

Whether this is a test or a live analysis, decided by the key that created it.

Value in"test""live"
status*"queued"

queued: waiting for its files to be ready or for processing to start.

Value in"queued"
external_id?ExternalId

Your own reference, such as a case number. It is returned unchanged, need not be unique and is never used to detect duplicates.

Length1 <= length
catalog_version?CatalogVersion

The catalog version the analysis was created with. Later catalog changes do not affect it.

Length1 <= length
reference_date?Date

The date against which document ages and periods are evaluated: the date you sent, or the UTC date of creation.

Formatdate
engine_revision?EngineRevision

The version of the analysis engine that produced the result. Test analyses report test-fixtures.v<n>, and deployments with mock models report a revision starting with mock-.

Length1 <= length
expires_at?DateTime

When the analysis and its result are deleted automatically.

Formatdate-time
usage?

What the analysis processed. A completed analysis reports pages, fields and checks, also when they are zero.

Example Request
curl -X POST 'https://api.aircredit.de/partner/v1/analyses/ana_19c0/cancel'
Example Response
{  "id": "ana_2a77",  "mode": "live",  "status": "queued",  "catalog_version": "sha256:235de54bf23a933aa613918eecfcd9e08da12d48ffdb98f80f77bda29cb5590e",  "reference_date": "2026-10-07",  "expires_at": "2026-11-06T10:31:04Z"}