const override = await unkey.setOverride({
    identifier: "user_123",
    limit: 10,
    duration: 60000,
    namespaceName: "email.outbound",
    async: true
})
{
  result: {
     overrideId: 'rlor_12345'
  }
}

Request

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
limit
number
required
How many requests may pass in a given window.
duration
number
required
The window duration in milliseconds.
Either namespaceId or namespaceName is required. Not both.
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

Response

result
const override = await unkey.setOverride({
    identifier: "user_123",
    limit: 10,
    duration: 60000,
    namespaceName: "email.outbound",
    async: true
})
{
  result: {
     overrideId: 'rlor_12345'
  }
}