# List API request logs

Source: https://docs.vlayers.ai/reference/logs/list-request-logs

`GET /v1/request-logs` · scope `logs:read`

Returns the API requests made with your workspace's keys, newest first: method, route, status, error code, latency and request id (never bodies). Kept 14 days. Use it to find out why a request failed, by its `requestId`.

Requires an API key with the `logs:read` scope.

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `after` | query | string | no | The previous page's `nextCursor`: older requests. Example: `"eyJ0IjoiMjAyNi0xMC0yMFQxNTowNDowNVoifQ"` |
| `since` | query | string | no | A page's `latestCursor`: only newer requests, oldest first. Use it to tail the log. Example: `"eyJ0IjoiMjAyNi0xMC0yMFQxNTowNDowNVoifQ"` |
| `status` | query | "all" \| "error" \| "ok" | no | `error` for status 400 and above, `ok` for the rest. Example: `"error"` |
| `apiKeyId` | query | string | no | Only requests made with this key. Example: `"key_7f2a91"` |
| `limit` | query | integer | no | How many items to return, 1–200. Default 50. Example: `20` |

## Request

cURL:

```bash
curl "https://api.vlayers.ai/v1/request-logs?status=error&limit=20" \
  -H "Authorization: Bearer $VOICELAYER_API_KEY"
```

TypeScript:

```ts
import { createVoiceLayerClient, listRequestLogs } from '@voicelayer/api';

const client = createVoiceLayerClient({ apiKey: process.env.VOICELAYER_API_KEY!, throwOnError: true });

const { data } = await listRequestLogs({
  client,
  query: {
    status: 'error',
    limit: 20
  }
});
console.log(data.logs);
```

Python:

```python
import os
import voicelayer

config = voicelayer.Configuration(access_token=os.environ["VOICELAYER_API_KEY"])
with voicelayer.ApiClient(config) as client:
    api = voicelayer.LogsApi(client)
    result = api.list_request_logs(
        status="error",
        limit=20,
    )
    print(result.logs)
```

## Response `200`

```json
{
  "logs": [
    {
      "id": "0192f5b2-1b2c-7d3e-8f4a-5b6c7d8e9f01",
      "method": "POST",
      "route": "/v1/messages",
      "status": 202,
      "errorCode": null,
      "apiKeyId": "key_7f2a91",
      "latencyMs": 148,
      "requestId": "req-8f2c1d",
      "idempotencyKey": "7f3c9a2e-5b1d-4c8e-9f0a-2d6b8e4c1a37",
      "createdAt": "2026-10-20T15:04:05.000Z"
    }
  ],
  "nextCursor": null,
  "latestCursor": "eyJ0IjoiMjAyNi0xMC0yMFQxNTowNDowNVoifQ"
}
```
