Source: docs/integration/errors.md

API errors

The Public API uses JSON errors. The OpenAPI contract is authoritative for the

status and shape of each route.

Most Public API routes return:

{
  "error": "Invalid API key",
  "code": "UNAUTHORIZED"
}

The HTTP channel returns a structured error object:

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid JSON body"
  }
}

Recovery guide

StatusTypical codesRecovery
400VALIDATION_ERROR, INVALID_CREDENTIAL, MANIFEST_INVALIDFix the request using the OpenAPI schema; do not retry unchanged input.
401UNAUTHORIZEDConfirm the API key and base URL belong to the same environment; ask the administrator to reissue the bundle if needed.
404CAPABILITY_NOT_FOUNDConfirm the capability ID belongs to the current access bundle.
405METHOD_NOT_ALLOWEDUse the method documented for the route.
409CONFLICT, CONTRACT_TEST_REQUIRED, CREDENTIAL_NOT_CONFIGUREDResolve the current capability state, then retry the logical operation.
413REQUEST_TOO_LARGEReduce the credential request to the documented limit.
422VALIDATION_ERRORSend a text message with a non-empty body and valid fields.
500AGENT_RUNTIME_ERROR, INTERNAL_ERRORApply the host application's retry policy and retain the response code for support.
503CREDENTIAL_VAULT_UNAVAILABLEDo not rotate repeatedly; retry according to the host policy and contact the operator if it persists.

Never log API keys, endpoint tokens, authorization headers, or complete request

bodies containing secrets. For a suspected leak, stop and request rotation.