Kernsignal/API docs

Errors

Errors

Every non-2xx response has the same JSON shape.

{
  "error": {
    "type": "invalid_request_error",
    "code": "file_too_large",
    "message": "synthetic_file exceeds 50 MB",
    "param": "synthetic_file"
  }
}

type says what kind of problem it is, code is a stable identifier to branch on, message is for people, param names the offending field or is null.

Types

typeHTTPMeaning
invalid_request_error400The request is malformed or not allowed in the current state. Fix it; retrying does not help.
authentication_error401The API key is missing, malformed or revoked.
permission_error403The key is valid but may not do this.
not_found_error404No such resource, or it belongs to another account.
rate_limit_error429Too many requests. Wait for the Retry-After header, then retry.
api_error500Something failed on our side. Retry with backoff; use an Idempotency-Key when creating audits.

Codes you may meet

codetypeMeaning
file_too_largeinvalid_request_errorAn uploaded file is over the size limit (50 MB per file).
invalid_jsoninvalid_request_errorThe request body is not a JSON object.
missing_parameterinvalid_request_errorA required field is absent. param names it.
audit_not_foundnot_found_errorNo audit with that id in your account.
audit_not_finishedinvalid_request_errorThe audit has not succeeded, so it cannot be verified.
audit_not_verifiableinvalid_request_errorThe audit succeeded but lacks the recorded input hashes or result needed for a record.
verification_requires_human_evidenceinvalid_request_errorThe audit had no human_file, or no question was scored against human answers, so no verification record or badge is issued. Submit the audit again with a human file.
verification_not_foundnot_found_errorNo verification with that id, or none exists yet for that audit.
verification_revokedinvalid_request_errorA revoked record cannot be edited.
live_key_requiredpermission_errorA ks_test_ key tried to delete a live audit.
invalid_display_nameinvalid_request_errordisplay_name must be printable text of at most 80 characters, or null.
invalid_reasoninvalid_request_errorreason must be 1 to 200 printable characters.
invalid_descriptioninvalid_request_errordescription must be a string of at most 200 characters.
unsafe_urlinvalid_request_errorThe webhook URL is not https, uses an IP address or credentials, or resolves to a non-public address.
invalid_eventsinvalid_request_errorUnknown event name in events.
too_many_endpointsinvalid_request_errorThe account already has 10 webhook endpoints.
webhook_endpoint_not_foundnot_found_errorNo such webhook endpoint in your account.
missing_api_keyauthentication_errorNo Authorization: Bearer header was sent.
invalid_api_keyauthentication_errorThe API key is malformed or unknown.
revoked_api_keyauthentication_errorThe API key has been revoked.
route_not_foundnot_found_errorNo such endpoint, or the method is not allowed on it.
invalid_parameterinvalid_request_errorA field has the wrong type or value. param names it.
unknown_parameterinvalid_request_errorThe request has a field this endpoint does not accept.
invalid_configinvalid_request_errorconfig is not a valid JSON object or contains an invalid value (for example exclude that is not an array of column names).
invalid_multipartinvalid_request_errorThe multipart body could not be parsed.
request_too_largeinvalid_request_errorThe whole request body is over the limit (two files of 50 MB plus 1 MB), or a JSON body is over 64 KB.
unsupported_file_typeinvalid_request_errorThe file extension is not one of the accepted types.
empty_fileinvalid_request_errorAn uploaded file is empty.
invalid_file_contentinvalid_request_errorThe file content does not match its type.
invalid_idempotency_keyinvalid_request_errorIdempotency-Key must be 1 to 255 printable characters.
idempotency_key_reusedinvalid_request_errorThe Idempotency-Key was already used with different parameters or files.
audit_not_readyinvalid_request_errorReports exist only for succeeded audits.
queue_fullrate_limit_errorToo many audits are waiting. Retry in a minute.
internal_errorapi_errorSomething failed on our side. Retry with backoff.
verification_not_configuredapi_errorThe server has no signing key configured. This is our fault; email hello@kernsignal.ai.

Branch on code and treat unknown codes by their type: new codes are added over time.