Organisation Roles

Delete a role

DELETE/roles/{id}
roles:writedelete_roleDestructiveIdempotent

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

  • idintegerRequired#

    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

204

The role was deleted.

401

Authentication failed. error.code is one of invalid_token, expired, revoked.

Error
403

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.

Error
404

Resource not found (error.code = not_found).

Error
409

The request conflicts with existing state (error.code = conflict), e.g. a compliance flow with the requested name already exists.

Error
422

The request can't be processed (HTTP 422): validation_failed with one ErrorDetail per problem, or a code documented on the operation.

Error
429

Rate limit exceeded (error.code = rate_limited).

Error

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"