POST
/
v1
/
permissions.createRole
curl --request POST \
  --url https://api.unkey.dev/v1/permissions.createRole \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "dns.records.manager",
  "description": "dns.records.manager can read and write dns records for our domains."
}'
{
  "roleId": "role_123"
}

To use this endpoint, your root key must have the rbac.*.create_role permission.

Changelog

DateChanges
Jul 08 2024Introduced endpoint

Authorizations

Authorization
string
header
required

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

Body

application/json
name
string
required

The unique name of your role.

Required string length: 3 - 256
description
string

Explain what this role does. This is just for your team, your users will not see this.

Required string length: 3 - 256

Response

200
application/json
Sucessfully created a role
roleId
string
required

The id of the role. This is used internally