POST
/
v1
/
ratelimits.setOverride
Set rate limit override
curl --request POST \
  --url https://api.unkey.dev/v1/ratelimits.setOverride \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "namespaceId": "rlns_1234",
  "namespaceName": "email.outbound",
  "identifier": "user_123",
  "limit": 10,
  "duration": 60000,
  "async": false
}'
{
  "overrideId": "over_123"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
identifier
string
required

Identifier of your user, this can be their userId, an email, an ip or anything else. Wildcards ( * ) can be used to match multiple identifiers, More info can be found at https://www.unkey.com/docs/ratelimiting/overrides#wildcard-rules

Minimum length: 3
Example:

"user_123"

limit
integer
required

How many requests may pass in a given window.

Required range: x >= 0
Example:

10

duration
integer
required

The window duration in milliseconds

Required range: x >= 1000
Example:

60000

namespaceId
string

The id of the namespace. Either namespaceId or namespaceName must be provided

Example:

"rlns_1234"

namespaceName
string

Namespaces group different limits together for better analytics. You might have a namespace for your public API and one for internal tRPC routes. Wildcards can also be used, more info can be found at https://www.unkey.com/docs/ratelimiting/overrides#wildcard-rules

Example:

"email.outbound"

async
boolean
default:false

Async will return a response immediately, lowering latency at the cost of accuracy.

Response

Sucessfully created a ratelimit override

overrideId
string
required

The id of the override. This is used internally

Example:

"over_123"