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

# List Users

> List all users associated with a given entity.

<Info>
  **Entity ID**

  To retrieve your entity\_id, use [List Portfolios](/api-reference/prime-api/rest-api/portfolios/list-portfolios).
</Info>

Use the Prime SDK or CLI to test this endpoint by following the [quickstart](/prime/introduction/quickstart) guide and running with the following examples

<Tabs>
  <Tab title="Java">
    ```java theme={null}
    UsersService usersService = PrimeServiceFactory.createUsersService(client);

    ListUsersRequest request = new ListUsersRequest.Builder()
        .entityId("ENTITY_ID_HERE")
        .build();

    ListUsersResponse response = usersService.listUsers(request);
    ```

    For more information, please visit the [Prime Java SDK](https://github.com/coinbase-samples/prime-sdk-java).
  </Tab>

  <Tab title=".NET">
    ```csharp wrap theme={null}
    var usersService = new UsersService(client);

    var request = new ListUsersRequest("ENTITY_ID_HERE");

    var response = usersService.ListUsers(request);
    ```

    For more information, please visit the [Prime .NET SDK](https://github.com/coinbase-samples/prime-sdk-dotnet).
  </Tab>

  <Tab title="Go">
    ```go wrap theme={null}
    usersService := users.NewUsersService(client)

    request := &users.ListEntityUsersRequest{
        EntityId: "ENTITY_ID_HERE",
    }

    response, err := usersService.ListEntityUsers(context.Background(), request)
    ```

    For more information, please visit the [Prime Go SDK](https://github.com/coinbase-samples/prime-sdk-go).
  </Tab>

  <Tab title="Python">
    ```python wrap theme={null}
    prime_client = PrimeClient(credentials)

    request = ListUsersRequest(
        entity_id="ENTITY_ID_HERE",
    )

    response = prime_client.list_users(request)
    ```

    For more information, please visit the [Prime Python SDK](https://github.com/coinbase-samples/prime-sdk-py).
  </Tab>

  <Tab title="CLI">
    ```bash wrap theme={null}
    primectl list-entity-users --help
    ```

    For more information, please visit the [Prime CLI](https://github.com/coinbase-samples/prime-cli).
  </Tab>

  <Tab title="TS/JS">
    ```typescript wrap theme={null}
    const usersService = new UsersService(client);

    usersService.listUsers({
        entityId: 'ENTITY_ID_HERE'
    }).then(async (response) => {
        console.log('Users: ', response);
    })
    ```

    For more information, please visit the [Prime TS SDK](https://github.com/coinbase-samples/prime-sdk-ts).
  </Tab>
</Tabs>


## OpenAPI

````yaml GET /v1/entities/{entity_id}/users
openapi: 3.0.1
info:
  title: REST API
  description: >-
    The Coinbase Prime REST API provides programmatic access to trading,
    custody, staking, market data, and account management functionality.
  version: '0.1'
servers:
  - url: https://api.prime.coinbase.com/
security: []
tags:
  - name: PrimeRESTAPI
paths:
  /v1/entities/{entity_id}/users:
    get:
      tags:
        - Users
      summary: List Users
      description: List all users associated with a given entity.
      operationId: PrimeRESTAPI_GetEntityUsers
      parameters:
        - name: entity_id
          in: path
          description: The entity ID
          required: true
          schema:
            type: string
        - name: cursor
          in: query
          description: Cursor used for pagination (last consumed record)
          schema:
            type: string
        - name: limit
          in: query
          description: Number of items to retrieve
          schema:
            type: integer
            format: int32
        - name: sort_direction
          in: query
          description: Sorting order
          schema:
            type: string
            default: DESC
            enum:
              - DESC
              - ASC
      responses:
        '200':
          description: A successful response.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/coinbase.public_rest_api.GetEntityUsersResponse
components:
  schemas:
    coinbase.public_rest_api.GetEntityUsersResponse:
      type: object
      properties:
        users:
          type: array
          description: The entity users.
          items:
            $ref: '#/components/schemas/coinbase.public_rest_api.EntityUser'
        pagination:
          $ref: '#/components/schemas/coinbase.public_rest_api.PaginatedResponse'
    coinbase.public_rest_api.EntityUser:
      type: object
      properties:
        id:
          type: string
          description: The unique ID of the user
          example: 54496de6-7cbd-4abb-8489-2675c4d1f8f7
        name:
          type: string
          description: The name of the user
          example: Frank Malone
        email:
          type: string
          description: The email of the user
          example: user@coinbase.com
        entity_id:
          type: string
          description: >-
            The entity to which this user and associated permissions are
            identified
          example: 2c521d6c-1cfb-4371-bf9c-5a42938d3e75
        role:
          $ref: '#/components/schemas/coinbase.public_rest_api.UserRole'
        roles:
          type: array
          description: All primary roles assigned to the user.
          items:
            $ref: '#/components/schemas/coinbase.public_rest_api.UserRole'
        secondary_permissions:
          type: array
          description: All secondary permissions assigned to the user.
          items:
            $ref: '#/components/schemas/coinbase.public_rest_api.SecondaryPermission'
    coinbase.public_rest_api.PaginatedResponse:
      required:
        - has_next
        - next_cursor
        - sort_direction
      type: object
      properties:
        next_cursor:
          type: string
          description: Cursor to navigate to next page
        sort_direction:
          $ref: '#/components/schemas/coinbase.public_rest_api.SortDirection'
        has_next:
          type: boolean
          description: >-
            A boolean value indicating whether there are more items to paginate
            through
    coinbase.public_rest_api.UserRole:
      title: Indicates the user's role
      type: string
      description: |-
        - USER_ROLE_UNKNOWN: nil value
         - AUDITOR: An auditor
         - SIGNATORY: A signatory
         - ADMIN: An admin
         - INITIATOR: An initiator
         - REVIEWER: A reviewer
         - TRADER: A trader
         - FULL_TRADER: A trader with full permissions
         - TEAM_MANAGER: A team manager
         - APPROVER: An approver
         - TAX_MANAGER: A tax manager
         - BUSINESS_MANAGER: A business manager
      enum:
        - AUDITOR
        - SIGNATORY
        - ADMIN
        - INITIATOR
        - REVIEWER
        - TRADER
        - FULL_TRADER
        - TEAM_MANAGER
        - APPROVER
        - TAX_MANAGER
        - BUSINESS_MANAGER
    coinbase.public_rest_api.SecondaryPermission:
      title: Indicates the user's secondary permission
      type: string
      description: |-
        - SECONDARY_PERMISSION_UNKNOWN: nil value
         - VIDEO_APPROVER: A video approver
         - TEAM_APPROVER: A team approver
         - WEB3_SIGNER: A web3 signer
      enum:
        - VIDEO_APPROVER
        - TEAM_APPROVER
        - WEB3_SIGNER
    coinbase.public_rest_api.SortDirection:
      type: string
      default: DESC
      enum:
        - DESC
        - ASC

````