Errors

How a failed request is reported, what to do about each error code, the rate limits and limits, and why an analysis can fail.

A failed request returns an HTTP error status. The body is a problem as defined in RFC 9457, with the content type application/problem+json. The problem is the top-level object:

{
  "type": "https://api.aircredit.de/problems/invalid-spec",
  "title": "Invalid specification",
  "status": 422,
  "detail": "Invalid specification",
  "request_id": "req_example",
  "errors": [{"pointer": "/spec/checks/income/uses/0", "code": "unknown_field_key",
              "message": "The referenced field is unknown."}]
}

In this example, the uses list of a custom check names a field that does not exist. A problem has these members:

  • type identifies the kind of problem, title names it and detail explains it.
  • status repeats the HTTP status.
  • request_id repeats the x-request-id response header.
  • instance, when present, identifies this occurrence.
  • errors lists each problem with a part of the request. Every entry has a pointer to that part, written as an RFC 6901 JSON Pointer, a machine-readable code and a message. An error in a header has the root pointer "".

Base your error handling on the code, not on the wording of a message. New codes can appear in v1. Handle a code you do not know by its HTTP status.

Error codes

StatusCodesWhat to do
400invalid_requestFix the syntax, the headers or the shape of the body.
401invalid_api_keyCheck the API key. Replace a revoked key.
402insufficient_balanceTop up the prepaid balance, then retry with the same Idempotency-Key and body.
403api_client_disabled, permission_deniedUse a key that may perform this operation, or create a new one.
404not_foundCheck the ID, and that it belongs to the integration and mode of your key.
405method_not_allowedUse the documented HTTP method.
409idempotency_conflict, conflictSend the original request again, or use a new Idempotency-Key for a new request.
409upload_in_progress, preview_not_readyWait, then retry.
409analysis_in_progressCancel the analysis and wait until it has finished before you delete it.
409file_limit_reachedDelete files or wait for them to expire, then retry (Limits).
409partner_data_purge_in_progressThe workspace that owns the integration is being deleted. Stop sending new requests.
410resource_deletedYour resource was deleted or has expired. Create a new one.
410api_version_retiredThis major version is retired. Move to its successor (Versioning).
413payload_too_largeMake the uploaded file or the JSON request body smaller.
415unsupported_content_typeUse a supported media type, and UTF-8 for text.
422invalid_spec, invalid_field, unsupported_language, unsupported_candidate, duplicate_requirement_key, unknown_field_key, unknown_catalog_key, document_too_large, unreadable_documentCorrect the part of the request that errors points to. Do not send custom document types.
429rate_limitedWait Retry-After seconds, then retry with the same Idempotency-Key and body.
500internal_errorRetry with backoff. If the error persists, report the request_id.
501not_implementedThe request uses a capability that is not supported. Do not retry it unchanged.
503service_unavailableRetry with backoff. For a create request, use the same Idempotency-Key and body.

402 insufficient_balance occurs only with live keys. Its problem type is https://api.aircredit.de/problems/insufficient-balance. The request created nothing and charged nothing. Billing explains how to top up.

Rate limits

AirCredit limits the number of requests in three ways:

  • Each integration has its own request budget, shared by its test and live keys.
  • Test requests also draw on a second budget, shared by the test keys of all integrations in your workspace.
  • Requests from one IP address share a ceiling across all integrations.

429 rate_limited has only three causes. A request exceeds one of these budgets, processing capacity is exhausted, or too many analyses are in progress (Concurrent analyses). The response always has a Retry-After header in seconds. Wait at least that long, then retry with the same Idempotency-Key and body.

Limits

These are the current default limits. They can change, so rely on the error codes, not on the numbers.

LimitDefaultWhen exceeded
Retained files per integration and mode256409 file_limit_reached on upload
Files per analysis32422 invalid_spec
Queued or running analyses per integration and mode32429 rate_limited with Retry-After
Pages per document500An analysis of the document fails
Upload size100 MiB413 payload_too_large
JSON request body1 MiB413 payload_too_large
Resolved fields per analysis, including check dependencies256422 invalid_spec
Checks per analysis128422 invalid_spec
Collection requirements per analysis128422 invalid_spec
Months across all period collection requirements1200422 invalid_spec

A file counts against the retained-file limit until it is deleted or expires. Test files expire 24 hours after upload at the latest (Test mode).

Execution failures

An analysis can also fail after AirCredit has accepted the create request. Reading it then returns HTTP 200 with status: failed and an error object. Today its code is one of these. New codes can appear.

CodesCause
input_unavailableAn input file could not be read, or was deleted or replaced before the analysis ran
permission_deniedThe integration lost the permission to run the analysis
deadline_exceededProcessing ran out of time
document_too_largeA document exceeds the processing limits
classification_failed, extraction_failed, cross_validation_failed, check_failedA classification, extraction, cross-validation or check that the analysis needs failed
processing_failedAirCredit could not complete the analysis for a reason on its side

Treat a code you do not know like processing_failed. If processing_failed or deadline_exceeded persists across new analyses, report the analysis id.

These codes are separate from the HTTP problem codes above and from reason: not_implemented on a document requirement. A failed check inside a succeeded analysis has its own error (Checks).

A retry with the same Idempotency-Key does not restart a failed analysis. Fix the cause, then create a new analysis with a new key.

On this page