Skip to main content

get-role

Retrieve details about a specific role using the Unkey CLI including its name, description, and list of assigned permissions for RBAC review.
1 min read

Retrieve details about a specific role including its assigned permissions.

Use this to verify role configuration, check which permissions are currently assigned, or retrieve metadata for access review. Accepts either a role ID (starting with role_) or a role name.

Required permissions:

  • rbac.*.read_role (to read roles in any workspace)
Note

See the API reference for the full HTTP endpoint documentation.

Usage#

Flags#

--rolestringrequired#

Role ID (starting with role_) or role name to retrieve. Must be 1-128 characters. Returns complete role information including all assigned permissions.

Global Flags#

FlagTypeDescription
--root-keystringOverride root key ($UNKEY_ROOT_KEY)
--api-urlstringOverride API base URL (default: https://api.unkey.com)
--configstringPath to config file (default: ~/.unkey/config.toml)
--outputstringOutput format. Use json for raw JSON
--bodystringSend this JSON string as the request body. You cannot combine it with request-building flags.

Examples#

Output#

Default output shows the request ID, followed by the role details:

With --output=json, the full response envelope is returned: