Skip to content

List Roles

Retrieve a paginated list of roles defined in a project.

Endpoint

/api/v1/projects/{project_id}/roles

Method

GET

Path Parameters

ParameterTypeRequiredDescription
project_idstringYesUnique ID of the project

Headers

HeaderRequiredDescription
AuthorizationYesBearer access token: Bearer <access_token>

Query Parameters

ParameterTypeRequiredDescription
page_numintegerNoPage number (default: 1)
page_sizeintegerNoResults per page (default: 10)
sort_bystringNoField name to sort by. Option:
  • created_at (default)
  • updated_at
  • name
  • code
sort_dirstringNoSort direction. Option:
  • asc
  • desc (default)
searchstringNoSearch keyword for role code, name, or description

Required Permission

roles:read

Examples

curl --request GET \
  --url https://auth.roled.io/api/v1/projects/2JUSLUee46xG6iEwG8JwPc/roles \
  --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJo...'

Error Codes

CodeHTTP StatusDescription
invalid_authorization_token401Unauthorized request. The authorization token is missing or invalid.
insufficient_permission403Insufficient permissions to access this resource.
project_not_found404The requested project could not be found.
system_error500An unexpected error occurred. Please try again later.