ratelimit

Update ratelimit namespace

Changed on

Rename a rate limit namespace, identified by its ID or current name.

Renaming to the current name returns the namespace without a write.

Important: Overrides stay with the namespace. Requests that pass the namespace by name, such as ratelimit.limit, must use the new name. A ratelimit.limit call with the old name can create a new, empty namespace with that name. A name that is in use or was deleted returns 409. Other API nodes can take up to a minute to see the new name.

Required Permissions

Your root key must have one of the following permissions:

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

Request

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

Request body

namespacestring required

The namespace to rename. Pass the namespace ID (rlns_...) or its current name.

namestring required

The new name of the namespace, unique within your workspace. Names are case-sensitive.

Example request

{
  "namespace": "rlns_1234abcd",
  "name": "email.outbound"
}

Response

Namespace renamed successfully.

Example response

{
  "meta": {
    "requestId": "req_123"
  },
  "data": {
    "id": "rlns_1234abcd",
    "name": "api.requests",
    "createdAt": 1704067200000,
    "updatedAt": 1704153600000
  }
}

Changes