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

# List the users holding a role

**🔒 Admin only.** Requires administrator privileges — the authenticated principal (API key, embed JWT, or any bearer token) must belong to a user with the admin role.

Lists every user holding the role, directly or through a group, newest first, cursor-paginated via `first`/`after`. Accepts built-in role ids. Each user carries every role they hold, so a combination such as "holds Explorer but not my custom role" is one pass over these pages. Deactivated users are included.

An API key scoped to specific deployments answers `403` here.


## OpenAPI

````yaml /api-reference/api.yaml get /api/v1/roles/{roleId}/users
openapi: 3.1.0
info:
  title: Cube Platform API
  version: 1.0.0
  description: >-
    Programmatically manage Cube: deployments and everything scoped to them

    (environments, folders, reports, workbooks, notifications, workspace, and
    agents),

    plus account-level users, groups, policies, embedding, and AI settings.
    Data-model

    authoring, dev mode, branches, and uploads live under /build/api/v1 — same
    host and

    token, routed to the build pods.
servers:
  - url: https://{tenant}.cubecloud.dev
    description: Your tenant host. Replace the whole host if you use a custom domain.
    variables:
      tenant:
        default: your-tenant
        description: Your Cube tenant subdomain
security:
  - bearerAuth: []
tags:
  - name: Deployments
  - name: Deployment Creation
  - name: Environments
  - name: Env Variables
  - name: Regions
  - name: Data Model
  - name: Data Model Uploads
  - name: GitHub
  - name: GitHub Connection
  - name: dbt Sync
  - name: Databricks Metric View Publication
  - name: Databricks Metric View Integration
  - name: Snowflake Semantic View Sync
  - name: Folders
  - name: Reports
  - name: External Documents
  - name: Workbooks
  - name: Workbook Promotions
  - name: Dashboard Exports
  - name: Notifications
  - name: Scheduled Tasks
  - name: Workspace
  - name: Agents
  - name: Users
  - name: Users Admin
  - name: API Keys
  - name: Roles
  - name: User Attributes
  - name: User Attribute Values
  - name: Tenant Settings
  - name: OAuth Integrations
  - name: User OAuth Tokens
  - name: OIDC Token Configs
  - name: App Theme
  - name: Embed
  - name: Embed Tenants
  - name: Dashboard Embed Access
  - name: Usage Analytics
  - name: OpenAPI Spec
  - name: Chat History
  - name: Ossie Conversion
  - name: Report Deliveries
paths:
  /api/v1/roles/{roleId}/users:
    get:
      tags:
        - Roles
      summary: List the users holding a role
      operationId: getRoleHolders
      parameters:
        - in: path
          name: roleId
          required: true
          schema:
            type: number
        - in: query
          name: after
          schema:
            oneOf:
              - type: string
              - type: 'null'
        - in: query
          name: first
          schema:
            oneOf:
              - minimum: 1
                type: integer
              - type: 'null'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RoleHoldersListResponse'
          description: ''
        '404':
          description: No role has that id. Cube's Admin role answers `404` too.
components:
  schemas:
    RoleHoldersListResponse:
      properties:
        items:
          items:
            $ref: '#/components/schemas/RoleHolder'
          type: array
        pageInfo:
          $ref: '#/components/schemas/PageInfo'
      required:
        - items
        - pageInfo
      type: object
    RoleHolder:
      properties:
        email:
          type: string
        firstName:
          oneOf:
            - type: string
            - type: 'null'
        id:
          type: integer
        isAdmin:
          description: Set by the user's own Admin flag or by a group granting Admin.
          type: boolean
        isDeactivated:
          type: boolean
        roles:
          items:
            $ref: '#/components/schemas/UserRoleAssignmentResponse'
          type: array
      required:
        - id
        - email
        - isDeactivated
        - isAdmin
        - roles
      type: object
    PageInfo:
      properties:
        endCursor:
          oneOf:
            - type: string
            - type: 'null'
        hasNextPage:
          type: boolean
        hasPreviousPage:
          type: boolean
        startCursor:
          oneOf:
            - type: string
            - type: 'null'
      required:
        - hasNextPage
        - hasPreviousPage
      type: object
    UserRoleAssignmentResponse:
      properties:
        builtIn:
          type: boolean
        description:
          oneOf:
            - type: string
            - type: 'null'
        direct:
          description: >-
            Assigned to the user directly — the assignment `DELETE
            /api/v1/roles/{roleId}/users/{userId}` removes.
          type: boolean
        groupIds:
          description: >-
            Groups that grant the role. Removing it from the user does not touch
            these; change the group instead.
          items:
            type: integer
          type: array
        id:
          description: Role id. Built-in roles have fixed negative ids.
          type: integer
        name:
          type: string
      required:
        - id
        - name
        - builtIn
        - direct
        - groupIds
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Token authentication. Send `Authorization: Bearer <YOUR_TOKEN>`.'

````

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