> ## Documentation Index
> Fetch the complete documentation index at: https://docs-api.kravata.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Request logs

> See the errors your integration gets from the Kravata API, and the errors your users hit in the widget or SDK.

Every error response from the Kravata API has the same shape and includes a `request_id`. You can use that id to look up the exact failure, with [Get Request Log by Request ID](/stack/api-reference/request-logs/get-request-log-by-request-id), or list your recent errors with [Get Request Logs](/stack/api-reference/request-logs/get-request-logs).

## Error format

```json theme={null}
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Operation with id 123 not found",
    "request_id": "8df2af7bb7e23e393e397ca489c47d54"
  },
  "detail": "Operation with id 123 not found"
}
```

* `error.code` is stable. Use it in your logic; the `message` is for people and may change.
* `error.request_id` is the same value as the `X-Request-ID` response header. Send it to support when you report a problem.
* `error.details` appears only on validation errors (`422`), with one entry per field.
* `detail` is kept for compatibility with existing integrations.
* Errors with status `500` show a generic message on purpose. The cause is recorded under the `request_id`.

To choose the request id yourself, send an `X-Request-ID` header. If you do not, Kravata generates one and returns it in the response.

## Find an error

List the failed requests of the last 7 days (the default):

```bash theme={null}
curl "https://partners-api.kravata.co/V1/api/v1/logs/requests?onlyErrors=true" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

Look up one request by its id:

```bash theme={null}
curl "https://partners-api.kravata.co/V1/api/v1/logs/requests/8df2af7bb7e23e393e397ca489c47d54" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

In the test environment use `https://test-api-kore.kravata.co/api/v1/logs/requests` (no `/V1` prefix).

## Errors your users hit in the widget or SDK

Set `source=widget` to list the failures that happened in the widget or SDK (for example, a login that failed on the device):

```bash theme={null}
curl "https://partners-api.kravata.co/V1/api/v1/logs/requests?source=widget&fromDate=2026-10-01T00:00:00Z" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

Widget entries have `source: "widget"`, `requestId: null` and an `errorCode` such as `WIDGET_LOGIN_FAILED`.

## Filters

| Parameter | Description |
| - | - |
| `fromDate`, `toDate` | ISO 8601 range. Default: the last 7 days. The range cannot exceed 90 days. |
| `source` | `partner_api` (default): calls you made to the API. `widget`: errors your users hit in the widget or SDK. |
| `onlyErrors` | `true` returns only responses with status 400 or higher. |
| `statusCode` | Exact HTTP status code. |
| `errorCode` | Exact `error.code`, for example `NOT_FOUND`. |
| `path` | Route of the request, for example `/api/v1/operations/{operation_id}`. |
| `requestId` | The `request_id` you received. |
| `page`, `pageSize` | Pagination. `pageSize` goes up to 200. |

## Response

```json theme={null}
{
  "items": [
    {
      "id": "5b0f6d7e-2a1c-4f9e-8d3b-7c6a1e2f9a10",
      "requestId": "8df2af7bb7e23e393e397ca489c47d54",
      "source": "partner_api",
      "service": "kmsk-transaction",
      "method": "POST",
      "path": "/api/v1/operations/withdrawal",
      "statusCode": 400,
      "errorCode": "BAD_REQUEST",
      "errorMessage": "Invalid amount",
      "latencyMs": 42,
      "occurredAt": "2026-10-05T15:22:14.635000+00:00"
    }
  ],
  "total": 1,
  "page": 1,
  "pageSize": 50
}
```

`errorMessage` is the message of the error body you received. It never contains internal details.

## What is recorded

* Calls you make to the Kravata API with your partner token, successful or not.
* Errors your users hit in the widget or SDK (`source=widget`).

Calls made with a user's session, for example from a front end that logs in with cookies, are not in `source=partner_api`.

## Retention

Request logs are kept for 90 days. Older entries are deleted automatically, and requests older than that return `404` from the single-request endpoint.

## Common error codes

| Code | Status | Meaning |
| - | - | - |
| `BAD_REQUEST` | 400 | The request is not valid. Read `error.message`. |
| `UNAUTHORIZED` | 401 | The access token is missing, expired or invalid. Request a new one. |
| `FORBIDDEN` | 403 | Your client is not allowed to do this. |
| `NOT_FOUND` | 404 | The resource does not exist for your client. |
| `VALIDATION_ERROR` | 422 | One or more fields are invalid. See `error.details`. |
| `CONFLICT` | 409 | The resource already exists or is in a state that does not allow the change. |
| `DUPLICATE_RECORD` | 400 or 409 | A record with the same unique value already exists. The status depends on the service. |
| `RATE_LIMITED` | 429 | Too many requests. Retry later. |
| `UPSTREAM_ERROR` | 502 | A provider the operation depends on failed. Retry later. |
| `UPSTREAM_TIMEOUT` | 504 | A provider the operation depends on did not respond in time. Retry later. |
| `SERVICE_UNAVAILABLE` | 503 | The service is temporarily unavailable. Retry later. |
| `INTERNAL_ERROR` | 500 | Something failed on our side. Contact support with the `request_id`. |

Some operations return more specific codes (for example `INSUFFICIENT_FUNDS` or `HASH_ID_ALREADY_IN_USE`). Use `error.code` to handle them, and `error.message` to show them to people.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.