Create permission
Changed onCreate a new permission to define specific actions or capabilities in your RBAC system. Permissions can be assigned directly to API keys or included in roles.
Use hierarchical naming patterns like documents.read, admin.users.delete, or billing.invoices.create for clear organization.
Important: Permission slugs must be unique within the workspace. Names do not need to be unique. Once created, permissions are immediately available for assignment.
Required Permissions
Your root key must have the following permission:
- rbac.*.create_permission
Request
- Base URLhttps://api.unkey.com
- URLhttps://api.unkey.com/v2/permissions.createPermission
- AuthHTTP bearer
Request body
Example request
{
"name": "users.read",
"slug": "users-read",
"description": "Grants read-only access to user profile information, account settings, and subscription status."
}Response
Permission created successfully
Example response
{
"meta": {
"requestId": "req_123"
},
"data": {
"permissionId": "perm_1234567890abcdef"
}
}Changes
- warning
changed the pattern of the request property
from^[a-zA-Z][a-zA-Z0-9._-]*$to^[a-zA-Z0-9_:\-\.\*]+$
- warning
- info
the endpoint scheme security
bearerwas added to the API - info
the endpoint scheme security
rootKeywas removed from the API
- info