Reading a failed request
- Every answer carries its request id in the
x-request-idheader. Read that request to see what was sent and what came back. - A
4xxis refused: the call can be fixed, and the answer’serror.fixsays what to change. A5xxfailed on Kontiga’s side: send it again with the sameIdempotency-Key. - The key is shown by its name, kind and last four characters. Its secret is never kept.
- Every value of yours reads
[withheld], a number[number withheld]and a true or false[boolean withheld], so the shape keeps its types: the log keeps the names of the fields, headers and parameters and the shape of the bodies, never a value, and a name that is not a plain one reads[name withheld]. An id in a path is kept when it is one of Kontiga’s (on the compatible API, a document’s token or request code); anything else there reads[withheld]. The API’s own words stay as sent, so a refused call reads back what was wrong: event types (and*),format,mode,method,enabled, a delivery’s or an endpoint’sstate, a status class,range,overlap,targetand Kontiga’s own ids, in a body and in a query; in an answer also a list’sobject,has_moreandnext_cursor, an object’sstate, its times (created_atand the other_atkeys) and its counts (attempts,resent,duration_ms,last_status). A header keeps a value only in a form that names no one:Content-TypeandAcceptas the media types the API takes and answers,User-Agentas the product names and versions of known clients and of plain lower-case names,Kontiga-Modeasliveortest,Originwhen a publishable key’s list let it read the answer; any other header is its name. A body that is not JSON is its type and size. What Kontiga answered stays readable: a refused call’s error code, message and the fields it named, and the id of what a call made. Thecurlform reads the key from$KONTIGA_API_KEYand leaves the withheld values for you to fill in, with a first line that says what goes where. A message of Kontiga’s that repeats a value you sent reads[message withheld: it repeats a value sent], its code kept. - Where a call came from is its country (
request.country, null when not known), never its address.aboutis the object a call was about (the id in its path, or the one a create made). - An error’s message that repeats a value the call sent (a name or an address in an unknown event type, say) reads
[message withheld: it repeats a value sent]; its code is kept. A path that matches no route keeps its first two segments and the length of the rest. - A call made in the console is in the audit log, not here: this log holds the calls made with keys. A revoked or expired key’s calls are not logged.
- A key reads the requests of its own mode’s keys: a test key sees no live request.
- Every request is counted. A refused one (
429, or a503while Kontiga sheds load) is kept as a request at most 5 times a second for each key, and a workspace keeps up to 256 MiB of bodies a day; past that, requests are kept without their bodies.
GET/v1/request_logs
Each request made with the workspace’s keys, newest first: time, method, path, status, the error’s code, duration, key, mode and request id. Each request is kept 7 days and the counts 30, with no personal data.
- Who may
- Owner, Admin and Developer
- CLI
kontiga logs list [--key-id <key_id>] [--mode <live|test>] [--status <2xx|4xx|5xx>] [--path </v1/...>] [--range <1h|24h|7d|30d>] [--request-id <req_...>] [--from-at <iso>] [--to-at <iso>] [--limit <n>] [--cursor <c_...>]- MCP tool
list_api_logs- Returns
- The requests that match, newest first. The first page (no cursor) also has how many matched in all, how many succeeded, were refused and failed, their median time, the routes called, and the range’s requests over time by result; a page read with a cursor has its requests only.
Parameters
key_idOnly requests made with this key.
modeLive or test requests: never both in one list. Left out, the call’s own mode (a key’s; the console’s switch). A key reads its own mode’s only. One of
live,test.statusOnly answers of this class:
2xxsucceeded,4xxrefused,5xxfailed.pathOnly requests whose route starts with this, such as
/v1/cases, or one object’s requests by its path with its whole id, such as/v1/documents/doc_0193c1a2b7d84e1f9a2b3c4d5e6f7081. At most 200 characters.rangeHow far back to read:
1h,24h,7dor30d. The requests themselves go back 7 days; the counts, the median and the columns 30.request_idOne request by its id, as the
x-request-idheader gave it, or the requests whose id starts withreq_and at least 8 of its hex characters.limitHow many to answer, a whole number from 1 to 200.
cursorThe
next_cursorof the page before. A page read with a cursor holds its requests only (items,next_cursor,has_more,from,to): the counts, the median, the routes and the columns come on the first page.from_atOnly requests from this time on, inside the range: a bucket’s
at.to_atOnly requests before this time: a bucket’s
to.
curl -X GET "https://api.kontiga.com/v1/request_logs?status=4xx&range=24h" \
-H "Authorization: Bearer $KONTIGA_API_KEY"GET /v1/request_logs
{
"object": "list",
"items": [
{
"id": "req_5e2a9c71d4b83f06a1c7e9d2",
"at": "2026-11-26T09:38:12Z",
"method": "POST",
"path": "/v1/cases/case_7Kq2Xw9/outcomes",
"route": "/v1/cases/{case_id}/outcomes",
"api": "kontiga",
"status": 403,
"error_code": "forbidden_scope",
"duration_ms": 41,
"key": {
"id": "key_2Wq7Hc4",
"name": "Onboarding service",
"kind": "restricted",
"mode": "live",
"prefix": "kt_live_",
"last4": "7Q2K"
},
"mode": "live",
"replay": false,
"object": "request_log",
"about": { "id": "case_7Kq2Xw9", "label": "Case", "href": "/console/cases/case_7Kq2Xw9" }
},
{
"id": "req_9b4d1e6a2c7f08e35d1a4b9c",
"at": "2026-11-26T09:37:55Z",
"method": "GET",
"path": "/v1/cases/case_7Kq2Xw9",
"route": "/v1/cases/{case_id}",
"api": "kontiga",
"status": 200,
"error_code": null,
"duration_ms": 63,
"key": {
"id": "key_2Wq7Hc4",
"name": "Onboarding service",
"kind": "restricted",
"mode": "live",
"prefix": "kt_live_",
"last4": "7Q2K"
},
"mode": "live",
"replay": false,
"object": "request_log",
"about": { "id": "case_7Kq2Xw9", "label": "Case", "href": "/console/cases/case_7Kq2Xw9" }
}
],
"total": 2602,
"succeeded": 2580,
"refused": 19,
"failed": 3,
"median_ms": 58,
"routes": [
{ "route": "/v1/documents/{document_id}", "count": 1259 },
{ "route": "/v1/cases/{case_id}", "count": 611 }
],
"buckets": [
{ "at": "2026-11-26T08:00:00Z", "to": "2026-11-26T09:00:00Z", "succeeded": 131, "refused": 4, "failed": 0 },
{ "at": "2026-11-26T09:00:00Z", "to": "2026-11-26T09:42:00Z", "succeeded": 88, "refused": 1, "failed": 1 }
],
"next_cursor": "c_179568347500000000000000004891327652918604528173",
"has_more": true,
"from": "2026-11-25T09:42:00Z",
"to": "2026-11-26T09:42:00Z"
}GET/v1/request_logs/{request_id}
One request by its request id: what was sent and what came back, the key masked and every value withheld, the error in plain words with what to change, and the call as a curl command.
- Who may
- Owner, Admin and Developer
- CLI
kontiga logs get <request_id>- MCP tool
get_api_log- Returns
- The request and its answer, the error explained, and a curl command that reads the key from its environment variable.
Parameters
request_idRequiredThe request’s id, from the
x-request-idheader of its answer. In the path.
curl -X GET https://api.kontiga.com/v1/request_logs/req_5e2a9c71d4b83f06a1c7e9d2 \
-H "Authorization: Bearer $KONTIGA_API_KEY"GET /v1/request_logs/{request_id}
{
"id": "req_5e2a9c71d4b83f06a1c7e9d2",
"at": "2026-11-26T09:38:12Z",
"method": "POST",
"path": "/v1/cases/case_7Kq2Xw9/outcomes",
"route": "/v1/cases/{case_id}/outcomes",
"api": "kontiga",
"status": 403,
"error_code": "forbidden_scope",
"duration_ms": 41,
"mode": "live",
"request": {
"url": "https://api.kontiga.com/v1/cases/case_7Kq2Xw9/outcomes",
"headers": [
["authorization", "Bearer kt_live_…7Q2K"],
["content-type", "application/json"],
["idempotency-key", "decide-APP-20418"]
],
"body": "{\"outcome\":\"[withheld]\",\"note\":\"[withheld]\"}",
"country": "SE",
"user_agent": "kontiga-node/1.4.0",
"origin": null,
"idempotency_key": "decide-APP-20418"
},
"response": {
"headers": [["x-request-id", "req_5e2a9c71d4b83f06a1c7e9d2"]],
"body": "{\"error\":{\"code\":\"[withheld]\",\"message\":\"[withheld]\"}}"
},
"error": {
"code": "forbidden_scope",
"message": "This key may not decide cases.",
"meaning": "The key works, but its scopes do not include deciding cases.",
"fix": "Add cases:write to the key's scopes in Developers > API keys, or call with a key that has it.",
"issues": []
},
"curl": "curl -X POST https://api.kontiga.com/v1/cases/case_7Kq2Xw9/outcomes -H \"Authorization: Bearer $KONTIGA_API_KEY\" -H \"Content-Type: application/json\" -d '{\"outcome\":\"[withheld]\",\"note\":\"[withheld]\"}'"
}