---
title: "Update ratelimit namespace"
method: POST
path: "/v2/ratelimit.updateNamespace"
tags: ["ratelimit"]
---

# Update ratelimit namespace

`POST /v2/ratelimit.updateNamespace`

## Request

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

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)

## Request body

- V2RatelimitUpdateNamespaceRequestBody
  - `namespace` string, required: The namespace to rename. Pass the namespace ID (`rlns_...`) or its current name.
  - `name` string, required: The new name of the namespace, unique within your workspace. Names are case-sensitive.

## Response `200`

Namespace renamed successfully.

- V2RatelimitUpdateNamespaceResponseBody
  - `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` RatelimitNamespace, required
    - `id` string, required: The unique identifier of the namespace, generated by Unkey.
    - `name` string, required: The name of the namespace, unique within your workspace. Pass it as `namespace` to `ratelimit.limit` and the override endpoints.
    - `createdAt` integer, required: Unix timestamp in milliseconds when the namespace was created.
    - `updatedAt` integer: Unix timestamp in milliseconds when the namespace was last updated. Omitted if the namespace has never been updated.

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden - The root key or the workspace is disabled, or the key can read the namespace but lacks the required permission. A key that cannot read the namespace gets 404 instead.
- `404`: Not Found - The namespace does not exist in your workspace, was deleted, or your root key cannot read it. All cases return the same response, so a root key cannot learn which namespaces exist.
- `409`: Conflict - The name is in use or was deleted
- `429`: Too Many Requests
- `500`: Internal server error

## Changes

- **2026-10-13** `d77169145d83`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/unkeyed/apis/unkey-api/changes/v2/ratelimit.updateNamespace/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)
