Request logs
Operations tagged Request logs in the public API.
About Request logs
A request log row is one /v1 request of the account: method, route pattern, status, duration and error code — never a body, header, query string or secret. It answers "why did my key stop working?" and "which workload is hitting the rate limit?".
What is recorded. Every request a key of the account made, written after the response is sent — including a 429 the rate limiter answered before the operation ran. A request whose key was refused is recorded too, with api_key_id: null and the reason in error_code (KEY_REVOKED, KEY_EXPIRED, KEY_ROTATION_GRACE_ENDED, IP_NOT_ALLOWED), but only when its secret matched, so nobody can write into another account's log. A request with an unknown key or none, and the unauthenticated GET /status and GET /openapi.json, are never recorded. Rows are kept for 90 days by default.
Who sees what. GET /request_logs (scope keys:read) lists the requests of every key of the account; a key restricted to selected agents lists only its own.
IDs you will meet.
id— the row id, newest highest. No operation takes it.api_key_id— the key that made the request; compare it withkey.idfromGET /me.request_id— the request'sX-Request-ID, also sent back in its response header and error body. Quote it to support.
List request logs
/v1 requests, newest first and cursor-paginated: method, route pattern, status, duration and error code — never a body, header or query string. Requests of every key of the account are listed (each row's api_key_id says which); a key restricted to selected agents lists only its own. A request whose key was refused — revoked, expired, past its rotation grace or outside its IP allowlist — is listed with api_key_id: null and the reason in error_code, as long as its secret matched. Rows are kept for 90 days by default.- Required scope
- keys:read
- Idempotency
- Read-only
- Rate limits
Query parameters
statusintegerOptionalOnly requests answered with this HTTP status code, e.g.429. Exact match; a value that is not a number is ignored.limitintegerOptionalPage size, clamped to 1–100.Default:
20Minimum:1Maximum:100starting_afterstringOptionalCursor from a previous page'snext_cursor: returns the page after it. A cursor minted for another list,sortororderis 422INVALID_CURSOR.ending_beforestringOptionalCursor from a previous page'sprevious_cursor: returns the page before it. Wins when both cursors are sent.created[gte]stringOptionalOnly rows created on or after this instant:YYYY-MM-DD(whole UTC day) or an RFC 3339 timestamp with a zone. Anything else is 422INVALID_PARAMETER.created[lte]stringOptionalOnly rows created on or before this instant:YYYY-MM-DD(whole UTC day) or an RFC 3339 timestamp with a zone. Anything else is 422INVALID_PARAMETER.
Responses
- 200Success.
objectstringRequiredAlways
listdataarray of ApiRequestLogResourceRequiredhas_morebooleanRequirednext_cursorstringnullableRequiredprevious_cursorstringnullableRequiredurlstringRequiredAlways
/v1/request_logs
- 400A tenant selector header named a tenant other than the API key's own (
ACCOUNT_SELECTOR_NOT_SUPPORTED): an all-digitX-Account-Idother than the key owner's id or, whileworkspaces.context_enabledis on, anX-Workspace-Idother than the key's workspace (ws_prefix optional, case-insensitive). A header naming the key's own tenant, or a non-numericX-Account-Id, is ignored; a key cannot switch tenants, so send neither.Error codesACCOUNT_SELECTOR_NOT_SUPPORTED
- 401Missing or invalid API key.
Error codesUNAUTHENTICATED
- 403The API key is missing a required scope.
Error codesACCOUNT_SUSPENDEDINSUFFICIENT_SCOPE
- 422Validation failed. See
error.details.Error codesINVALID_CURSORINVALID_PARAMETER
- 429Rate limited. Honour the Retry-After header before retrying.
Error codesRATE_LIMITED
- 500Unexpected server error. Retry with the same Idempotency-Key.
Error codesSERVER_ERROR
Request
curl -X GET 'https://api.agentency.com/v1/request_logs' \
-H "Authorization: Bearer <YOUR_KEY>" \
-H "Content-Type: application/json"Response
Example 200 response
{
"object": "list",
"data": [
{
"object": "api_request_log",
"id": 1,
"api_key_id": 1,
"request_id": "req_example",
"method": "POST",
"path": "/v1/chat",
"status": 200,
"duration_ms": 1240,
"error_code": null,
"created_at": "2026-01-01T00:00:00+00:00"
},
{
"object": "api_request_log",
"id": 1,
"api_key_id": 1,
"request_id": "req_example",
"method": "GET",
"path": "/v1/conversations/{id}",
"status": 404,
"duration_ms": 18,
"error_code": "NOT_FOUND",
"created_at": "2026-01-01T00:00:00+00:00"
},
{
"object": "api_request_log",
"id": 1,
"api_key_id": null,
"request_id": "req_example",
"method": "GET",
"path": "/v1/chatbots",
"status": 401,
"duration_ms": 4,
"error_code": "KEY_REVOKED",
"created_at": "2026-01-01T00:00:00+00:00"
}
],
"has_more": false,
"next_cursor": null,
"previous_cursor": null,
"url": "/v1/request_logs"
}