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

# Request logs

> See every call your server made with an API key, including the ones that failed.

Every request made with one of your API keys is logged, including requests rejected before they
did anything, such as a body that failed validation. When an integration misbehaves, the log
shows what actually reached Useroutr and what came back.

## In the dashboard

Open **Developers → Logs**. Filter to failed requests, or paste a request id from an error to
find the exact call. Each entry opens with its route, status, error code, duration, the key that
made it and its idempotency key.

## With the SDK

```ts theme={null}
const { data: failed } = await useroutr.requestLogs.list({ outcome: "failed" });

for (const log of failed) {
  console.log(log.method, log.path, log.status, log.error_code, log.request_id);
}
```

Every error the SDK throws carries the request's id, so you can go straight to its log:

```ts theme={null}
import { UseroutrError } from "@useroutr/sdk";

try {
  await useroutr.fundingIntents.create(params, { idempotencyKey: orderId });
} catch (error) {
  if (error instanceof UseroutrError && error.requestId !== undefined) {
    const { data } = await useroutr.requestLogs.list({ request_id: error.requestId });
    console.log(data[0]);
  }
  throw error;
}
```

Filter by `outcome` (`succeeded` or `failed`), `request_id` or `api_key_id`.

## What is recorded

The method, the path without its query string, the matched route, the status, the error code, the
duration, the idempotency key, the key used and the request id.

<Note>
  Request and response bodies, headers and query strings are never recorded, so nothing your users
  sent is kept in a log. Requests from the dashboard are not logged. Logs are kept for 30 days.
</Note>


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