Skip to content
36 changes: 36 additions & 0 deletions apps/docs/errors/unkey/data/ratelimit_namespace_gone.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Ratelimit Namespace Gone
---

## Description

This error occurs when you attempt to use a ratelimit namespace that has been deleted. Once a namespace is deleted, it cannot be restored through the API or dashboard.

## Error Code

`unkey/data/ratelimit_namespace_gone`

## HTTP Status Code

`410 Gone`

## Cause

The ratelimit namespace you're trying to access was previously deleted and is no longer available through the API or dashboard.

## Resolution

<Note>
Contact [support@unkey.dev](mailto:support@unkey.dev) with your workspace ID and namespace name if you need this namespace restored.
</Note>

## Prevention

To avoid accidentally deleting namespaces:
- Restrict namespace deletion via workspace permissions
- Carefully review namespace-deletion requests before confirming

## Related

- [Ratelimit Namespace Not Found](/errors/unkey/data/ratelimit_namespace_not_found)
- [Rate Limiting Documentation](/ratelimiting/introduction)
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Instead of cramming everything into your API request:
<Note>
**Got a special use case?** If you have a legitimate need to send larger requests, we'd love to hear about it!

[Contact our support team](mailto:support@unkey.com) and include:
[Contact our support team](mailto:support@unkey.dev) and include:
- What you're building
- Why you need to send large requests
- An example of the data you're trying to send
Expand Down
14 changes: 14 additions & 0 deletions go/apps/api/openapi/gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 25 additions & 2 deletions go/apps/api/openapi/openapi-generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1825,6 +1825,23 @@ components:
"$ref": "#/components/schemas/Meta"
data:
"$ref": "#/components/schemas/V2RatelimitLimitResponseData"
GoneErrorResponse:
type: object
required:
- meta
- error
properties:
meta:
$ref: "#/components/schemas/Meta"
error:
$ref: "#/components/schemas/BaseError"
description: |-
Error response when the requested resource has been soft-deleted and is no longer available. This occurs when:
- The resource has been marked as deleted but still exists in the database
- The resource is intentionally unavailable but could potentially be restored
- The resource cannot be restored through the API or dashboard

To resolve this error, contact support if you need the resource restored.
V2RatelimitListOverridesRequestBody:
additionalProperties: false
properties:
Expand Down Expand Up @@ -5670,7 +5687,7 @@ paths:

Use this for rate limiting beyond API keys - limit users by ID, IPs by address, or any custom identifier. Supports namespace organization, variable costs, and custom overrides.

**Important**: Always returns HTTP 200. Check the `success` field to determine if the request should proceed.
**Response Codes**: Successful ratelimit checks return HTTP 200. 4xx responses indicate auth, namespace existence/deletion, or validation errors (e.g., 410 Gone for deleted namespaces). 5xx responses indicate server errors.

**Required Permissions**

Expand Down Expand Up @@ -5750,7 +5767,7 @@ paths:
schema:
$ref: '#/components/schemas/V2RatelimitLimitResponseBody'
description: |
Rate limit check completed. Always returns HTTP 200 - check the `success` field to determine if the request is allowed.
Rate limit check completed successfully. Check the `success` field to determine if the request is allowed.
"400":
content:
application/json:
Expand All @@ -5775,6 +5792,12 @@ paths:
schema:
$ref: '#/components/schemas/NotFoundErrorResponse'
description: Not Found
"410":
content:
application/json:
schema:
$ref: '#/components/schemas/GoneErrorResponse'
description: Gone - Namespace has been deleted
"500":
content:
application/json:
Expand Down
16 changes: 16 additions & 0 deletions go/apps/api/openapi/spec/error/GoneErrorResponse.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
type: object
required:
- meta
- error
properties:
meta:
$ref: "../common/Meta.yaml"
error:
$ref: "./BaseError.yaml"
description: |-
Error response when the requested resource has been soft-deleted and is no longer available. This occurs when:
- The resource has been marked as deleted but still exists in the database
- The resource is intentionally unavailable but could potentially be restored
- The resource cannot be restored through the API or dashboard

To resolve this error, contact support if you need the resource restored.
10 changes: 8 additions & 2 deletions go/apps/api/openapi/spec/paths/v2/ratelimit/limit/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ post:

Use this for rate limiting beyond API keys - limit users by ID, IPs by address, or any custom identifier. Supports namespace organization, variable costs, and custom overrides.

**Important**: Always returns HTTP 200. Check the `success` field to determine if the request should proceed.
**Response Codes**: Rate limit checks return HTTP 200 regardless of whether the limit is exceeded - check the `success` field in the response to determine if the request should be allowed. 4xx responses indicate auth, namespace existence/deletion, or validation errors (e.g., 410 Gone for deleted namespaces). 5xx responses indicate server errors.

**Required Permissions**

Expand Down Expand Up @@ -90,7 +90,7 @@ post:
success: true
overrideId: ovr_2cGKbMxRyIzhCxo1Idjz8q
description: |
Rate limit check completed. Always returns HTTP 200 - check the `success` field to determine if the request is allowed.
Rate limit check completed successfully. Check the `success` field to determine if the request is allowed.
"400":
description: Bad request
content:
Expand All @@ -115,6 +115,12 @@ post:
application/json:
schema:
"$ref": "../../../../error/NotFoundErrorResponse.yaml"
"410":
description: Gone - Namespace has been deleted
content:
application/json:
schema:
"$ref": "../../../../error/GoneErrorResponse.yaml"
"500":
description: Internal server error
content:
Expand Down
1 change: 1 addition & 0 deletions go/apps/api/routes/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ func Register(srv *zen.Server, svc *Services) {
Ratelimit: svc.Ratelimit,
RatelimitNamespaceCache: svc.Caches.RatelimitNamespace,
TestMode: srv.Flags().TestMode,
Auditlogs: svc.Auditlogs,
},
)

Expand Down
Loading