POST
/
v1
/
ratelimits.setOverride

Create or update an override to set specific limits for an identifier.

There is no update endpoint. Instead you should call this endpoint again to overwrite your override.

Changelog

DateChanges
Nov 25 2024Introduced endpoint

Authorizations

Authorization
string
headerrequired

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
limit
integer
required

How many requests may pass in a given window.

Required range: x > 0
duration
integer
required

The window duration in milliseconds

Required range: x > 1000
namespaceId
string

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

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

async
boolean
default: false

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

Response

200 - application/json
overrideId
string
required

The id of the override. This is used internally