---
title: "List API requests"
method: POST
path: "/v2/logs.listApiRequests"
tags: ["logs"]
---

# List API requests

`POST /v2/logs.listApiRequests`

## Request

- Base URL: `https://api.unkey.com`
- URL: `https://api.unkey.com/v2/logs.listApiRequests`
- Auth: HTTP bearer

List the requests that the Unkey API served for your workspace, newest first.

Filter by time, path, method, request ID, and status. In one field, values under `is`, `contains`, `startsWith`, and `endsWith` are combined with OR. Values under `isNot` and `notContains`, and the range operators `gt`, `gte`, `lt`, and `lte`, are combined with AND. Different fields are combined with AND. Every text match is exact and case-sensitive.

To get the next page, send the `pagination.cursor` of the previous page together with the same `filters`. A cursor does not expire, but rows older than the log retention leave the listing.

Unkey returns only requests inside the log retention of your workspace. The calls to this endpoint are not logged.

**Required Permissions**

Your root key must have the following permission:
- `unkey:v1:<workspace_id>:logs/apiRequests#read`

## Request body

- V2LogsListApiRequestsRequestBody
  - `limit` integer: The maximum number of requests to return in one page.
  - `cursor` string: The `pagination.cursor` of the previous page. Send the same `filters` with every page of one listing. Omit the cursor to get the first page.
  - `filters` V2LogsListApiRequestsFilters: Filters for the listing. A missing field does not filter. Different fields are combined with AND.
    - `time` TimeFilter: Filters by the time of the event, in Unix milliseconds. Every bound is combined with AND. Rows older than the workspace's retention are never returned or counted, whatever the bounds.
      - `gt` integer: Keep events after this time.
      - `gte` integer: Keep events at or after this time.
      - `lt` integer: Keep events before this time.
      - `lte` integer: Keep events at or before this time.
    - `path` TextFilter: Filters a text field. Every operator is exact and case-sensitive. `%` and `_` match only themselves. The positive operators (`is`, `contains`, `startsWith`, `endsWith`) are combined with OR. The negated operators (`isNot`, `notContains`) are combined with AND.
      - `is` string[]: The values of one filter operator. A row matches a positive operator when it matches any value in the list. A row matches a negated operator only when it matches none of the values.
      - `isNot` string[]: The values of one filter operator. A row matches a positive operator when it matches any value in the list. A row matches a negated operator only when it matches none of the values.
      - `contains` string[]: The values of one filter operator. A row matches a positive operator when it matches any value in the list. A row matches a negated operator only when it matches none of the values.
      - `notContains` string[]: The values of one filter operator. A row matches a positive operator when it matches any value in the list. A row matches a negated operator only when it matches none of the values.
      - `startsWith` string[]: The values of one filter operator. A row matches a positive operator when it matches any value in the list. A row matches a negated operator only when it matches none of the values.
      - `endsWith` string[]: The values of one filter operator. A row matches a positive operator when it matches any value in the list. A row matches a negated operator only when it matches none of the values.
    - `method` MethodFilter: Filters by HTTP method.
      - `is` HttpMethod[]: Keep rows with one of these methods.
      - `isNot` HttpMethod[]: Remove rows with one of these methods.
    - `requestId` ExactFilter: Filters a field that matches only as a whole value, such as a host or a request ID. Matching is exact and case-sensitive.
      - `is` string[]: The values of one exact filter operator. A row matches `is` when it equals any value in the list. A row matches `isNot` only when it equals none of the values. Exact matches take up to 25 values, so one call can look up a page of requests by ID.
      - `isNot` string[]: The values of one exact filter operator. A row matches `is` when it equals any value in the list. A row matches `isNot` only when it equals none of the values. Exact matches take up to 25 values, so one call can look up a page of requests by ID.
    - `status` IntFilter: Filters an integer field. `is` keeps rows that equal one of its values. `isNot` and every bound (`gt`, `gte`, `lt`, `lte`) are combined with AND, so `{ "is": [200], "gte": 400 }` matches no rows.
      - `is` integer[]: The values of one filter operator. A row matches `is` when it equals any value in the list. A row matches `isNot` only when it equals none of the values.
      - `isNot` integer[]: The values of one filter operator. A row matches `is` when it equals any value in the list. A row matches `isNot` only when it equals none of the values.
      - `gt` integer: Keep rows where the field is greater than this value.
      - `gte` integer: Keep rows where the field is greater than or equal to this value.
      - `lt` integer: Keep rows where the field is less than this value.
      - `lte` integer: Keep rows where the field is less than or equal to this value.

## Response `200`

A page of requests, newest first. When `hasMore` is true, send `pagination.cursor` to get the next page.

- V2LogsListApiRequestsResponseBody
  - `meta` Meta, required: Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The `requestId` is particularly important when troubleshooting issues with the Unkey support team.
    - `requestId` string, required: A unique id for this request. Always include this ID when contacting support about a specific API request. This identifier allows Unkey's support team to trace the exact request through logs and diagnostic systems to provide faster assistance.
  - `data` ApiRequestLog[], required: The requests that match the filters, newest first.
    - `requestId` string, required: The ID that the Unkey API returned in `meta.requestId` for this request.
    - `time` integer, required: When the Unkey API received the request, in Unix milliseconds.
    - `host` string, required: The host the request was sent to.
    - `method` string, required: The HTTP method of the request.
    - `path` string, required: The path of the request.
    - `status` integer, required: The HTTP status of the response.
    - `latencyMs` integer, required: How long the Unkey API took to serve the request, in milliseconds.
    - `requestHeaders` string[], required: Request headers as `Name: value` strings. Credential headers show `[REDACTED]`.
    - `requestBody` string, required: The request body. Secret values are redacted.
    - `responseHeaders` string[], required: Response headers as `Name: value` strings.
    - `responseBody` string, required: The response body. Secret values are redacted.
  - `pagination` Pagination, required: Pagination metadata for list endpoints. Provides information necessary to traverse through large result sets efficiently using cursor-based pagination.
    - `cursor` string: Opaque pagination token for retrieving the next page of results. Include this exact value in the cursor field of subsequent requests. Cursors are temporary and may expire after extended periods.
    - `hasMore` boolean, required: Indicates whether additional results exist beyond this page. When true, use the cursor to fetch the next page. When false, you have reached the end of the result set.

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden - Insufficient permissions (requires `unkey:v1:<workspace_id>:logs/apiRequests#read`)
- `422`: The query exceeds a query limit
- `500`: Internal server error
- `503`: The log store is not available

## Changes

- **2026-10-29** `98f3840fcf12`: 1 info
  - removed the non-success response with the status `429`
- **2026-10-23** `80dfd2ad3baf`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/unkeyed/apis/unkey-api/changes/v2/logs.listApiRequests/post.md)

---

[API](https://skmtc.dev/unkeyed/apis/unkey-api.md) - [All operations](https://skmtc.dev/unkeyed/apis/unkey-api/llms.txt) - [OpenAPI document](https://skmtc.dev/unkeyed/apis/unkey-api/revisions/6fbaa27f19e0?raw)
