Skip to content

Resources

Errors

A failed call answers with an HTTP status and a JSON body:

JSON
{
  "error": "invalid_body",
  "request_id": "0f8e2c4a-6b1d-4e3f-9a7c-5d2b8e1f4a60",
  "doc_url": "https://developers.komplai.dk/errors/invalid_body"
}
FieldContents
errorThe code. Each code has its own page, listed below.
request_idThe same id as the response's Request-Id header. Quote it when you ask komplai about a call.
doc_urlThe page for the code, with what happened and what to do.

The OpenAPI document describes this body as components.schemas.Error.

Some codes add fields that help you act: hint with engine_retired and mapping_not_available, state with job_not_finished, nerDeployment with ner_location_unavailable, estimatedSeconds and holdSeconds with use_job, and pages with scanned_pages_not_supported. The example on each code's page shows them. Apart from a Coding stream that has already begun, a failed call returns no partial result.

A few codes are the web server's own reason phrases, such as Not Found or Payload Too Large. Their bodies also carry the server's message and statusCode.

Handle errors by status

Branch on the HTTP status first and the code second, and treat a code you do not know by its status.

StatusWhat it meansWhat to do
400, 413, 415, 422The request, the text or the file cannot be processed as sent.Correct it. The same request gets the same answer.
401The key is missing, unknown, expired or revoked.Check that you send the whole key, or create a new one.
403The key may not do this: a scope is missing, the tool is not assigned to you, the processing is not approved, or an organisation integration key cannot use the operation.Use a key with the right access, or ask your organisation's administrator.
404No text job with that id for this key, a model or connection you named is not available to you, or no operation has that method and path.Check the id, the key, the model or connection and the path.
409The request conflicts with the current state.Read the code: some ask you to send the request again, some to wait, and others need a change.
410A text job ended without a result.Submit the text again as a new job.
429A limit is reached.For a request limit, wait the seconds in Retry-After, then try again. For an AI spending limit, see below.
500, 502, 503komplai or a service behind it failed or is unavailable.Try again later. If the call may have reached a model, do not send it again automatically.
504The time ran out.After processing_timeout, send the text as a text job. After timeout, the outcome is unknown.

A response without a Request-Id header was answered before the API handled the call, for example by the gateway while the API restarts. Treat it by its status.

When to try again

  • 429 with Retry-After. rate_limited and processing_capacity_busy say how many seconds to wait in Retry-After, at most 60. A 429 from the per-IP limit also has x-ratelimit-limit, x-ratelimit-remaining and x-ratelimit-reset. Limits lists the limits.
  • 429 for AI spending. After ai_credit_exhausted and person_ai_credit_exhausted, waiting does not help: a monthly cap starts again next month. Choose local processing, or ask your organisation's administrator about the limit.
  • A model may have answered. After a 502, 503 or 504 on a call that reaches a model, such as Chat or a synchronous Redact call with llm, the model may already have worked and EU cloud usage may already count towards the cap. Do not resend such calls automatically. Text jobs and Coding have their own protection against duplicates: see Retries and idempotency.
  • Busy local infrastructure. model_busy (503) on POST /v1/redact also sends Retry-After. A text job waits for its turn by itself.
  • Other 4xx answers do not change by trying again. Correct the request, the key or the access first, unless the code's page tells you to send the request again, as processing_access_changed does.

Text jobs

A text job that fails ends in state failed, cancelled or invalidated, and GET /v1/redact/jobs/{id} names the reason in error. GET /v1/redact/jobs/{id}/result then answers 410. Codes that only end a text job, such as redact_job_stalled, have no HTTP status of their own and are listed under Text jobs at the end of the index.

Errors in the Coding stream

When POST /v1/coding/chat/completions fails after the stream has begun, the last event is data: {"error": {"message": "…", "code": "…", "request_id": "…", "doc_url": "…"}} without data: [DONE]. Treat the outcome as unknown.

Codes

400 Bad Request

CodeMeaning
Bad RequestFastify's reason phrase: a path parameter does not have the documented form, for example a job id that is not a UUID.
empty_filefile.data decodes to nothing.
engine_retiredengine review, the separate LLM engine, is retired. Send engine pipeline, or leave engine out, with detectors ["regex", "llm"]; hint says the same. Nothing was reserved or processed.
file_type_mismatchThe extension or contentType disagrees with the file's content.
invalid_bodyThe body is not a JSON object with the documented fields: invalid JSON, Content-Type text/plain, an unknown field, a field of the wrong type, or a required field that is missing or blank.
invalid_coding_inputThe body is not a coding request as documented.
invalid_detectorsdetectors is empty, has an unknown or repeated value, or more than three values.
invalid_filefile is missing or malformed (filename missing, blank, longer than 255 characters or with control characters; data not a string; an unknown key), or the PDF or Word file itself is damaged or not a Word document.
invalid_file_encodingfile.data is empty or not base64.
invalid_idempotency_keyIdempotency-Key is not a UUID, or it was sent more than once.
invalid_includeinclude has an unknown or repeated value.
invalid_inputThe request is not what the operation documents, for example invalid JSON, a field that is not listed or a value out of range.
invalid_jobjob is not a UUID.
invalid_mappingmapping is not an object, or a value is empty, not a string, or contains NUL or a lone surrogate.
invalid_ner_deploymentnerDeployment is not eu-de or local.
invalid_placeholderA mapping key is empty, longer than 128 UTF-16 code units, has surrounding spaces, contains NUL or a lone surrogate, or is `__proto__`, `constructor` or `prototype`.
invalid_processingprocessing is not local or eu-cloud.
invalid_request_idX-Request-Id is missing or not a version 4 UUID.
invalid_restore_sourceSend exactly one of mapping and job.
invalid_sourcessources has an unknown or repeated value.
invalid_text_encodingtext contains NUL or a lone UTF-16 surrogate.
llm_model_not_applicablemodel was sent, but llm is not in detectors, or engine is not pipeline.
llm_model_not_validatedThe language model in model is not validated for Redact at the processing you chose. GET /v1/access lists the models you may name.
ner_deployment_without_nernerDeployment was sent, but ner is not in detectors (or mode is regex).
ner_model_unavailableThe NER model in nerModel is retired or does not run at the chosen place. A model other than the default also needs detectors.
ner_model_unknownNo NER model has the id in nerModel. GET /v1/access lists the models you may choose.
ner_model_without_nernerModel was sent, but ner is not in detectors (or mode is regex).
reasoning_not_supportedThe coding model does not take this reasoning_effort.
unsupported_engine_detectorsThe detectors do not fit engine agentic: it needs regex and llm, with optional ner.
unsupported_engine_modemode disagrees with detectors. Leave mode out when you send detectors.
unsupported_engine_sourcessources was sent without engine agentic.
unsupported_file_typeThe file is neither a PDF nor a Word .docx, by its content, its extension or its contentType.
unsupported_pilot_modemode is not regex or ner, or semantic is true. No language model runs on this operation.
unsupported_processingprocessing eu-cloud needs llm in detectors (and engine pipeline). Add llm to detectors.
unsupported_redact_engineengine is not one of the documented values.
unsupported_redact_modemode is not regex, ner or semantic.
unsupported_redact_policypolicy is not all-detected.

401 Unauthorized

CodeMeaning
api_key_requiredNo Authorization: Bearer header with a komplai key.
invalid_api_keyThe key is unknown, expired, revoked or retired, the person behind a personal key is no longer a member or no longer assigned any app the key covers, or your organisation's API access for it is not set up or no longer active.
invalid_tokenThe key was revoked or expired, or its access ended, while the request was admitted or processed.

403 Forbidden

CodeMeaning
agentic_lookup_not_allowedA source in sources is not approved by the organisation's administrator.
agentic_preview_not_enabledThe organisation's administrator has not turned on the Redact Agentic preview.
ai_credit_not_grantedNo monthly AI spending cap is set up for this month, so eu-cloud cannot run.
app_not_assignedThe key's person lost the app or their membership while the request was admitted.
approved_redact_storage_policy_requiredYour organisation processes personal data but has no approved storage policy for text jobs.
coding_not_enabledCoding is not enabled for the organisation, its Chat does not run in komplai's EU cloud with an approved setup, or the key's person is not assigned Chat.
identity_retiredThe person behind a personal key has been removed from komplai.
insufficient_scopeThe key lacks a scope the operation needs (x-komplai-scopes): it was not issued or created with it, its person is no longer assigned the app, or the organisation's processing approval no longer covers it.
integration_not_permittedAn organisation integration key cannot use this operation or this option.
ner_model_preview_requiredThe NER model in nerModel is a preview. It needs your organisation's Redact preview, which an organisation integration key does not have.
processing_access_changedThe organisation's processing setup changed while the request was handled. Send it again.
processing_access_withdrawnAccess to the job was withdrawn after it was created: the agreement, the processing setup, the organisation's redaction rules or the storage policy for text jobs changed. The job is invalidated and its text and result are deleted. This is final: stop reading the job and do not reuse its Idempotency-Key; submit the text again as a new job when access allows it.
processing_choice_not_allowedThe organisation does not allow this processing (local infrastructure or EU cloud) through the API, or the connection is not made available through the API.
processing_not_approvedThe organisation's processing approval for the app is missing or was withdrawn.
processing_not_enabledThe processing is not enabled for the app in the organisation: EU processing is not approved and enabled, or the agreement keeps processing on local infrastructure.

404 Not Found

CodeMeaning
connection_not_foundNo connection with this id is available to you through the API.
model_not_enabledThe model is not one you may use at this processing, or it is not offered there right now.
Not FoundFastify's reason phrase: no operation has this method and path.
not_foundNo job with this id for this key. A job is visible only to the key that created it, and it disappears when it expires.

409 Conflict

CodeMeaning
connection_model_unavailableThe provider behind the connection does not know the model the connection names.
duplicate_requestThis X-Request-Id was used before with this key, so nothing was sent to the model.
idempotency_conflictThis Idempotency-Key was used with a different body. Use a new UUID for a new job.
job_not_finishedThe job is still queued or running; state says which. Try again after Retry-After seconds.
llm_model_not_validatedThe language model in model is not validated for Redact at the processing you chose. GET /v1/access lists the models you may name.
mapping_not_availableThe job kept neither mapping nor changes; hint says how to submit it again.
model_not_enabledThe model is not one you may use at this processing, or it is not offered there right now.
processing_access_changedThe organisation's processing setup changed while the request was handled. Send it again.
processing_policy_changedYour organisation's redaction rules changed while the request ran. Send it again.
reasoning_effort_not_supportedThe reasoning effort komplai set for this EU language model in Redact is not one the model accepts on your organisation's EU route. Nothing was sent to the model, and the API does not send another effort.
reasoning_not_enabledThe model does not take this reasoning_effort, or one of the organisation's own connections was sent one other than none.
terms_changedX-Komplai-Contract is not the current contract: the provider, its terms, the data mode, the agreement or the coding models and their prices changed.

410 Gone

CodeMeaning
redact_job_attempts_exhaustedThe text job was interrupted three times, for example by restarts, and was stopped. No partial result is kept.
redact_job_cancelledThe job was deleted or cancelled.
redact_job_failedThe job failed for a reason that is not passed on, for example a reached monthly AI spending cap or a failing EU cloud model.
redact_job_unavailableThe job ended without a result and without a stored reason.

413 Content Too Large

CodeMeaning
context_limitThe input and the requested output do not fit the model: max_tokens is over the model's limit, the input with max_tokens is over its context, or, in Redact, a part of the text does not fit even after it was asked again in halves down to 1,500 characters.
exceeds_ner_windowtext is over 16,000 UTF-16 code units, or the body is over 100,000 bytes. Use POST /v1/redact for longer texts.
file_too_complexReading the file took more than 120 seconds or more resources than allowed (memory, ZIP entries, XML size or depth).
file_too_largeThe file is over 50 MiB, or the body is over its byte limit.
Payload Too LargeFastify's reason phrase: the body is over the operation's byte limit.
processing_complexity_exceededThe text needs more work than its length allows: more candidate matches or matched characters than the per-character bounds in /v1/access, coreference matching work beyond its per-character bound (for example one name nested inside itself thousands of times), or more time for the organisation rules than their limit, which grows with the text and the number of rules. The bounds grow with the text, so splitting it rarely helps. Nothing partial is returned.
restore_too_largeThe body, the mapping (more than 100,000 entries, more than 2,000,000 UTF-16 code units or more than 500 fixed tokens) or the restored text (over 8,000,000 UTF-16 code units) is too large.
result_too_largeThe result would be over 32 MiB. Ask for fewer include reports or split the text.
text_too_largetext is over the operation's limit in UTF-16 code units, or the body is over its byte limit.
too_many_pagesThe PDF has more than 2,000 pages.
use_jobThe run cannot finish within the 300 seconds a synchronous call may take. estimatedSeconds is komplai's estimate from its measured speeds, with an empty queue; holdSeconds is the limit. Nothing was processed or charged. Send the same body as a text job (POST /v1/redact/jobs), or this call with Prefer: respond-async.

415 Unsupported Media Type

CodeMeaning
invalid_bodyThe body is not a JSON object with the documented fields: invalid JSON, Content-Type text/plain, an unknown field, a field of the wrong type, or a required field that is missing or blank.
Unsupported Media TypeFastify's reason phrase: the body has no Content-Type, or one the API does not read, such as XML or form data.

422 Unprocessable Content

CodeMeaning
encrypted_fileThe PDF is password protected.
invalid_filefile is missing or malformed (filename missing, blank, longer than 255 characters or with control characters; data not a string; an unknown key), or the PDF or Word file itself is damaged or not a Word document.
no_text_foundThe file contains no text at all.
scanned_pages_not_supportedA page has no text layer, for example a scan. No OCR runs. pages lists the pages; allowPagesWithoutText true processes the rest.

429 Too Many Requests

CodeMeaning
ai_credit_exhaustedThe organisation's monthly AI spending cap for EU cloud is reached, or its own lower limit, or on a pilot the pilot's total allowance. Local processing keeps working.
connection_rate_limitedThe provider behind the connection refused the call for now.
person_ai_credit_exhaustedYour personal AI limit is reached (personal keys only).
processing_capacity_busyAll organisation-rule workers in this API process are busy. There is no queue: try again after Retry-After.
rate_limitedToo many requests: the per-minute limit of the person behind a personal key (shared with that person's other keys and use of the hub) or of the integration behind an organisation integration key (shared by its keys), the organisation's (120), the API's (300) or the per-IP network limit. Wait Retry-After seconds.
upstream_rate_limitedThe coding model's provider refused the call for now.

500 Internal Server Error

CodeMeaning
Internal Server ErrorFastify's reason phrase for a failure the API did not expect.

502 Bad Gateway

CodeMeaning
agent_no_progressRedact Agentic stopped making progress: several rounds in a row read nothing new, found nothing and moved to no new step. No partial result is returned.
coding_service_unavailableThe coding model's provider failed or could not be reached, or an unexpected failure happened.
connection_failedThe provider behind one of the organisation's own connections could not be reached or failed.
connection_payment_requiredThe provider behind the connection wants payment on the organisation's account.
connection_request_refusedThe provider behind the connection refused the request, for example a value it does not take.
connection_unauthorizedThe provider refused the connection's key.
detection_service_unavailableThe detection service could not be reached or failed.
eu_cloud_refusedkomplai's EU cloud refused the call, so the model did not answer it.
incomplete_detectionA detection layer did not finish the whole text. No partial result is returned.
invalid_coding_responseThe model provider's stream failed validation.
invalid_detectionA detection layer returned output that failed validation. For llm: an answer that still could not be used after its part of the text was asked again in halves down to 1,500 characters.
invalid_responseThe model's answer failed validation, so nothing was returned.
service_unavailableThe model failed or could not be reached, or local infrastructure is not set up for this call right now.
unsafe_placeholderA fixed replacement token from your organisation's rules occurs in the text or collides with a label.

503 Service Unavailable

CodeMeaning
access_service_unavailableKeys and access could not be checked.
agentic_disabledengine agentic is switched off on this server.
agentic_lookup_unavailableA source in sources is not available right now.
chat_cloud_unavailableThe organisation's EU cloud setup cannot be used right now.
coding_not_configuredkomplai's EU route has no coding terms or coding models on this server.
coding_service_unavailableThe coding model's provider failed or could not be reached, or an unexpected failure happened.
connection_unavailableThe connection cannot be used: its key cannot be read or its address is refused.
detection_service_unavailableThe detection service could not be reached or failed.
detector_unavailabledetectors includes ner, but NER is not set up.
file_extraction_unavailableThe file reader could not start or stopped. This is not caused by the file.
gateway_misconfiguredThe connection to the detection service or the language model is misconfigured.
incoherent_redaction_policyYour organisation's redaction and allow rules conflict for this text.
invalid_organisation_policyYour organisation's redaction rules cannot be applied (more than 500 rules, or an invalid rule).
local_model_unavailableThe local language model in model is validated for Redact, but local infrastructure does not offer it right now. The API never picks another model.
model_busyThe language model on local infrastructure cannot take this call right now: its shared queue is full, or no node can run the model (for example while it restarts). Wait Retry-After seconds; a text job waits by itself.
ner_location_unavailableThe NER place cannot be used now: komplai has not switched it on for the API, or it did not answer. nerDeployment names the place. NER never moves to another place; GET /v1/access shows which places are available.
ner_model_unconfiguredThe NER model in nerModel is not set up at the default place on this server.
redact_capabilities_unavailableRedact's processing details could not be read.
redact_file_not_enabledFile input is switched off on this server.
redact_job_integrity_failedThe job's encrypted data could not be read.
redact_job_service_unavailableThe job store failed.
redact_jobs_not_enabledText jobs are not accepted right now; GET /v1/access shows text_contract.jobs_accepting_submissions.
redact_restore_unavailableUnexpected failure while restoring.
redact_runtime_unavailableA selected layer (NER or the language model) is not set up or not available right now.
semantic_runtime_not_configuredNo local language model is set up for llm.
service_unavailableThe model failed or could not be reached, or local infrastructure is not set up for this call right now.

504 Gateway Timeout

CodeMeaning
model_queue_expiredThe language model's shared queue on local infrastructure did not reach this call before its deadline. Try again later, or send it as a text job, which waits for its turn.
model_stalledThe language model stopped answering: its connection was silent, or it ran past the time its answer needs at the model's measured speed. No partial result is returned.
processing_timeoutThe call took more than 300 seconds, or the client disconnected. Send long texts as text jobs.
timeoutThe model did not answer in time. The call reached the model, so its outcome is unknown.

Text jobs

CodeMeaning
processing_outcome_uncertainA text job submitted before 20 October 2026 was interrupted during work by the language model, so komplai cannot tell whether that step finished. A job now resumes from its checkpoint instead.
redact_job_progress_failedThe worker could not record the job's progress, so it stopped the job instead of letting it run unrecorded. No partial result is kept. Submit it again.
redact_job_stalledThe job made no progress for 65 minutes, longer than any single step can take, and was stopped. Waiting for the language model on local infrastructure is not progress. No partial result is kept.
komplaidevelopers
Contact us

Search the documentation

Use the arrow keys to choose and Enter to open.