Delete a role
/roles/{id}Deletes the role together with its holders' assignments and its permission links, in one transaction. People who held it lose it silently, with no event of their own. A role that a SCIM group maps, or that the organisation uses as a default client role, returns 409 conflict: remap or change that first. Deleting takes away every permission the role has, so with a personal token you must hold them all, else 403 missing_permission naming the ones you lack; a service identity is refused only for super admin and super-admin-level permissions. A global role is read-only and returns 403 forbidden. It has no dry run. Emits role.deleted; no emails are sent. It can't be undone.
Path parameters
The role's id, a whole number from 1 to 2147483647. An unknown role, another organisation's role and a service role return 404.
Responses
The role was deleted.
Authorization failed. error.code is forbidden when the role is global and so read-only, missing_permission when the caller may not grant, take away or delete what the call touches, with the permissions in details, or one of missing_scope, scope_disabled, org_disabled, ip_blocked, user_disabled.
The request conflicts with existing state (error.code = conflict),
e.g. a compliance flow with the requested name already exists.
The request can't be processed (HTTP 422): validation_failed with one ErrorDetail per
problem, or a code documented on the operation.
Examples
curl -X DELETE https://your-org-domain/kong/core/api/v2/roles/{id}\
-H "Authorization: Bearer $HELM_API_KEY"\
-H "Content-Type: application/json"