ratelimit

List ratelimit namespaces

Changed on

Retrieve a paginated list of the rate limit namespaces in your workspace.

Use this to find the namespaces your services rate limit against, for example to build an admin view or to look up a namespace ID. Results are ordered newest first and returned in pages. When hasMore is true, pass the returned cursor to fetch the next page.

Deleted namespaces are not returned. The list contains only the namespaces your root key can read.

Required Permissions

Your root key must have one of the following permissions:

  • unkey:v1:<workspace_id>:projects/*/ratelimits/namespaces/*#read (to read any namespace)
  • unkey:v1:<workspace_id>:projects/<project_id>/ratelimits/namespaces/<namespace_id>#read (to read a specific namespace)
post/v2/ratelimit.listNamespaces

Request

  • Base URL
    https://api.unkey.com
  • URL
    https://api.unkey.com/v2/ratelimit.listNamespaces
  • Auth
    HTTP bearer

Request body

limitinteger

Maximum number of namespaces to return per request. Omit this field to receive up to 100 namespaces.

cursorstring

Pagination cursor from a previous response to fetch the next page. Use when hasMore: true in the previous response. Omit this field to start from the first page.

searchstring

Free-form text to filter namespaces. Returns namespaces whose ID or name contains the search string. Matching is case-insensitive. Omit this field to list every namespace.

Example request

{
  "cursor": "rlns_1234abcd",
  "search": "api"
}

Response

Successfully retrieved a page of namespaces. Use the pagination cursor for additional results when hasMore: true.

Example response

{
  "meta": {
    "requestId": "req_123"
  },
  "data": [
    {
      "id": "rlns_1234abcd",
      "name": "api.requests",
      "createdAt": 1704067200000,
      "updatedAt": 1704153600000
    }
  ],
  "pagination": {
    "cursor": "eyJrZXkiOiJrZXlfMTIzNCIsInRzIjoxNjk5Mzc4ODAwfQ==",
    "hasMore": true
  }
}

Changes