Delete role
Remove a role from your workspace. This also removes the role from all assigned API keys.
Important: This operation cannot be undone and immediately affects all API keys that had this role assigned.
Required Permissions
Your root key must have the following permission:
rbac.*.delete_role
1 min read
post/v2/permissions.deleteRole
Request example
Response
post/v2/permissions.deleteRole
Authorization
Body
application/jsonUnique identifier of the role to permanently delete from your workspace.
Must either be a valid role ID that begins with 'role_' or the given role name and exists within your workspace.
WARNING: Deletion is immediate and irreversible with significant consequences:
- All API keys assigned this role will lose the associated permissions
- Access to resources protected by this role's permissions will be denied
- Any authorization logic depending on this role will start failing
- Historical analytics referencing this role remain intact
Before deletion, ensure:
- You've updated any dependent authorization logic or code
- You've migrated any keys to use alternative roles or direct permissions
- You've notified relevant team members of the access changes
Length: 1–128
Responses
application/json
Role deleted successfully
Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The
requestId is particularly important when troubleshooting issues with the Unkey support team.Show child attributesHide child attributes
A unique id for this request. Always include this ID when contacting support about a specific API request. This identifier allows Unkey's support team to trace the exact request through logs and diagnostic systems to provide faster assistance.
Empty response object by design. A successful response indicates this operation was successfully executed.
Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The
requestId is particularly important when troubleshooting issues with the Unkey support team.Show child attributesHide child attributes
A unique id for this request. Always include this ID when contacting support about a specific API request. This identifier allows Unkey's support team to trace the exact request through logs and diagnostic systems to provide faster assistance.
Base error structure following Problem Details for HTTP APIs (RFC 7807). This provides a standardized way to carry machine-readable details of errors in HTTP response content.
Show child attributesHide child attributes
A human-readable explanation specific to this occurrence of the problem. This provides detailed information about what went wrong and potential remediation steps. The message is intended to be helpful for developers troubleshooting the issue.
HTTP status code that corresponds to this error. This will match the status code in the HTTP response. Common codes include
400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), 409 (Conflict), and 500 (Internal Server Error).A short, human-readable summary of the problem type. This remains constant from occurrence to occurrence of the same problem and should be used for programmatic handling.
A URI reference that identifies the problem type. This provides a stable identifier for the error that can be used for documentation lookups and programmatic error handling. When followed, this URI should provide human-readable documentation for the problem type.
List of individual validation errors that occurred in the request. Each error provides specific details about what failed validation, where the error occurred in the request, and suggestions for fixing it. This granular information helps developers quickly identify and resolve multiple issues in a single request without having to make repeated API calls.
Show child attributesHide child attributes
JSON path indicating exactly where in the request the error occurred. This helps pinpoint the problematic field or parameter. Examples include:
- 'body.name' (field in request body)
- 'body.items[3].tags' (nested array element)
- 'path.apiId' (path parameter)
- 'query.limit' (query parameter)
Use this location to identify exactly which part of your request needs correction.
Detailed error message explaining what validation rule was violated. This provides specific information about why the field or parameter was rejected, such as format errors, invalid values, or constraint violations.
A human-readable suggestion describing how to fix the error. This provides practical guidance on what changes would satisfy the validation requirements. Not all validation errors include fix suggestions, but when present, they offer specific remediation advice.
Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The
requestId is particularly important when troubleshooting issues with the Unkey support team.Show child attributesHide child attributes
A unique id for this request. Always include this ID when contacting support about a specific API request. This identifier allows Unkey's support team to trace the exact request through logs and diagnostic systems to provide faster assistance.
Base error structure following Problem Details for HTTP APIs (RFC 7807). This provides a standardized way to carry machine-readable details of errors in HTTP response content.
Show child attributesHide child attributes
A human-readable explanation specific to this occurrence of the problem. This provides detailed information about what went wrong and potential remediation steps. The message is intended to be helpful for developers troubleshooting the issue.
HTTP status code that corresponds to this error. This will match the status code in the HTTP response. Common codes include
400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), 409 (Conflict), and 500 (Internal Server Error).A short, human-readable summary of the problem type. This remains constant from occurrence to occurrence of the same problem and should be used for programmatic handling.
A URI reference that identifies the problem type. This provides a stable identifier for the error that can be used for documentation lookups and programmatic error handling. When followed, this URI should provide human-readable documentation for the problem type.
Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The
requestId is particularly important when troubleshooting issues with the Unkey support team.Show child attributesHide child attributes
A unique id for this request. Always include this ID when contacting support about a specific API request. This identifier allows Unkey's support team to trace the exact request through logs and diagnostic systems to provide faster assistance.
Base error structure following Problem Details for HTTP APIs (RFC 7807). This provides a standardized way to carry machine-readable details of errors in HTTP response content.
Show child attributesHide child attributes
A human-readable explanation specific to this occurrence of the problem. This provides detailed information about what went wrong and potential remediation steps. The message is intended to be helpful for developers troubleshooting the issue.
HTTP status code that corresponds to this error. This will match the status code in the HTTP response. Common codes include
400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), 409 (Conflict), and 500 (Internal Server Error).A short, human-readable summary of the problem type. This remains constant from occurrence to occurrence of the same problem and should be used for programmatic handling.
A URI reference that identifies the problem type. This provides a stable identifier for the error that can be used for documentation lookups and programmatic error handling. When followed, this URI should provide human-readable documentation for the problem type.
Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The
requestId is particularly important when troubleshooting issues with the Unkey support team.Show child attributesHide child attributes
A unique id for this request. Always include this ID when contacting support about a specific API request. This identifier allows Unkey's support team to trace the exact request through logs and diagnostic systems to provide faster assistance.
Base error structure following Problem Details for HTTP APIs (RFC 7807). This provides a standardized way to carry machine-readable details of errors in HTTP response content.
Show child attributesHide child attributes
A human-readable explanation specific to this occurrence of the problem. This provides detailed information about what went wrong and potential remediation steps. The message is intended to be helpful for developers troubleshooting the issue.
HTTP status code that corresponds to this error. This will match the status code in the HTTP response. Common codes include
400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), 409 (Conflict), and 500 (Internal Server Error).A short, human-readable summary of the problem type. This remains constant from occurrence to occurrence of the same problem and should be used for programmatic handling.
A URI reference that identifies the problem type. This provides a stable identifier for the error that can be used for documentation lookups and programmatic error handling. When followed, this URI should provide human-readable documentation for the problem type.
Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The
requestId is particularly important when troubleshooting issues with the Unkey support team.Show child attributesHide child attributes
A unique id for this request. Always include this ID when contacting support about a specific API request. This identifier allows Unkey's support team to trace the exact request through logs and diagnostic systems to provide faster assistance.
Base error structure following Problem Details for HTTP APIs (RFC 7807). This provides a standardized way to carry machine-readable details of errors in HTTP response content.
Show child attributesHide child attributes
A human-readable explanation specific to this occurrence of the problem. This provides detailed information about what went wrong and potential remediation steps. The message is intended to be helpful for developers troubleshooting the issue.
HTTP status code that corresponds to this error. This will match the status code in the HTTP response. Common codes include
400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), 409 (Conflict), and 500 (Internal Server Error).A short, human-readable summary of the problem type. This remains constant from occurrence to occurrence of the same problem and should be used for programmatic handling.
A URI reference that identifies the problem type. This provides a stable identifier for the error that can be used for documentation lookups and programmatic error handling. When followed, this URI should provide human-readable documentation for the problem type.