POST
/
v1
/
permissions.createPermission
Create permission
curl --request POST \
  --url https://api.unkey.dev/v1/permissions.createPermission \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Can write records",
  "slug": "record.write",
  "description": "record.write can create new dns records for our domains."
}'
{
  "permissionId": "perm_123"
}

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 permission.

Required string length: 3 - 256
Example:

"Can write records"

slug
string

The unique slug of your permission. If not provided, the name is used.

Required string length: 3 - 256
Example:

"record.write"

description

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

Required string length: 3 - 256
Example:

"record.write can create new dns records for our domains."

Response

Sucessfully created a permission

permissionId
string
required

The id of the permission. This is used internally

Example:

"perm_123"