> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nx1cloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List the Keycloak roles workspace access can be granted to

> List the Keycloak realm roles you can grant workspace roles to.

Returns role names and descriptions only, never who holds them.
Keycloak's built-in roles that every user holds (`offline_access`,
`uma_authorization`, `default-roles-*`) aren't listed and can't be
granted. Returns 503 when Keycloak can't be reached.

**Required roles**: `nx1_decisions_user` or `nx1_decisions_admin`



## OpenAPI

````yaml get /api/decisions/realm-roles
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/decisions/realm-roles:
    get:
      tags:
        - Decisions
      summary: List the Keycloak roles workspace access can be granted to
      description: |-
        List the Keycloak realm roles you can grant workspace roles to.

        Returns role names and descriptions only, never who holds them.
        Keycloak's built-in roles that every user holds (`offline_access`,
        `uma_authorization`, `default-roles-*`) aren't listed and can't be
        granted. Returns 503 when Keycloak can't be reached.

        **Required roles**: `nx1_decisions_user` or `nx1_decisions_admin`
      operationId: list_realm_roles_api_decisions_realm_roles_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RealmRoleListResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service Unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    RealmRoleListResponse:
      properties:
        roles:
          items:
            $ref: '#/components/schemas/RealmRoleInfo'
          type: array
          title: Roles
        total:
          type: integer
          title: Total
      type: object
      required:
        - roles
        - total
      title: RealmRoleListResponse
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
          description: A brief description of the error that occurred.
        code:
          type: integer
          title: Code
          description: The HTTP status code associated with the error.
          default: 500
      type: object
      required:
        - error
      title: ErrorResponse
    RealmRoleInfo:
      properties:
        name:
          type: string
          title: Name
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      type: object
      required:
        - name
      title: RealmRoleInfo
  securitySchemes:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.