POST
/
v1
/
keys.addRoles
Add key roles
curl --request POST \
  --url https://api.unkey.dev/v1/keys.addRoles \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "keyId": "<string>",
  "roles": [
    {
      "id": "role_123"
    },
    {
      "name": "dns.record.create"
    },
    {
      "name": "dns.record.delete",
      "create": true
    }
  ]
}'
[
  {
    "id": "role_123",
    "name": "dns.record.create"
  }
]

Authorizations

Authorization
string
header
required

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

Body

application/json

Response

200
application/json

All currently connected roles

The response is of type object[].