Create a root key with the permissions listed on this page under Root Keys in the dashboard sidebar. CLI commands can instead use a session from unkey login with the required permissions. See Permission reference for every permission.
unkey:v1:<workspaceId>:projects/<projectId>/identities/*#write for the workspace’s default project. To update an existing identity, it needs unkey:v1:{workspaceId}:projects/{projectId}/identities/{identityId}#write. It also needs unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>/keys/*#write for creating keys, and unkey:v1:<workspace_id>:projects/<project_id>/keyspaces/<keyspace_id>/keys/*#verify for the keyspace. Use the keyspace’s project ID for creating keys.
Create the identity with a limit
autoApply: true makes the limit count on every verification without the caller naming it.externalId earlier, the call returns HTTP 409 err:unkey:data:identity_already_exists. Use identities.updateIdentity with the same ratelimits array instead.Several limits on one identity
Add more than one limit when different operations need different budgets. A limit withautoApply: false is only checked when a verification names it, so an expensive endpoint can have its own budget.
requests (auto-applied) and tokens are checked together. If either is exceeded, the verification returns RATE_LIMITED and neither is consumed.
Exceptions for one key
If a key has a limit with the samename as one on its identity, the key’s limit wins for that key. Use this to give one integration a higher limit than the user’s other keys. Details are in Key and identity rate limits.