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

# List team users

> List users with team access, or filter to direct team roles.

> [!WARNING]
>
> This endpoint is experimental and may change or be removed without notice.


## OpenAPI

````yaml get /v1/teams/{team_id}/users
openapi: 3.1.0
info:
  description: REST API for management of Baseten resources
  title: Baseten management API
  version: 1.0.0
servers:
  - url: https://api.baseten.co
security:
  - BearerAuth: []
paths:
  /v1/teams/{team_id}/users:
    parameters:
      - $ref: '#/components/parameters/team_id'
    get:
      summary: Lists a team's users
      description: >-
        Lists the users with access to the team and their team roles, including
        users whose access comes only from a directory group or from being an
        organization admin. Pass `direct_only=true` to list only users given a
        team role. Service accounts and invited users aren't listed. Needs
        `team.read` on the team; without it, returns 404. May be deprecated
        later in favor of another way to look up a team's users.
      parameters:
        - name: cursor
          in: query
          required: false
          description: >-
            Opaque cursor returned by a previous page. Omit to fetch the first
            page.
          schema:
            anyOf:
              - type: string
              - type: 'null'
            default: null
            title: Cursor
        - name: limit
          in: query
          required: false
          description: Maximum number of items to return.
          schema:
            default: 100
            maximum: 1000
            minimum: 1
            title: Limit
            type: integer
        - name: direct_only
          in: query
          required: false
          description: >-
            When true, returns only users given a team role on this team,
            leaving out users whose access comes only from a directory group or
            from being an organization admin
          schema:
            default: false
            title: Direct Only
            type: boolean
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeamUsersV1'
      x-codeSamples:
        - lang: bash
          source: |
            curl --request GET \
            --url https://api.baseten.co/v1/teams/{team_id}/users \
            --header "Authorization: Bearer $BASETEN_API_KEY"
        - lang: python
          source: |-
            import requests
            import os
            API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
            url = "https://api.baseten.co/v1/teams/{team_id}/users"

            headers = {"Authorization": f"Bearer {API_KEY}"}

            response = requests.request(
                "GET",
                url,
                headers=headers,
                params={'cursor': None}
            )

            print(response.text)
components:
  parameters:
    team_id:
      schema:
        type: string
      name: team_id
      in: path
      required: true
  schemas:
    TeamUsersV1:
      description: A page of a team's users, ordered by user ID.
      properties:
        items:
          description: Items in this page.
          items:
            $ref: '#/components/schemas/TeamUserV1'
          title: Items
          type: array
        pagination:
          $ref: '#/components/schemas/PaginationResponseV1'
          description: Pagination metadata for the page.
      required:
        - items
        - pagination
      title: TeamUsersV1
      type: object
    TeamUserV1:
      description: A user's access to a team.
      properties:
        team_id:
          description: Unique identifier of the team
          title: Team Id
          type: string
        team_name:
          description: Name of the team
          title: Team Name
          type: string
        user_id:
          description: Unique identifier of the user
          title: User Id
          type: string
        user_name:
          anyOf:
            - type: string
            - type: 'null'
          description: Name of the user, or their email address when they have no name
          title: User Name
        user_email:
          anyOf:
            - type: string
            - type: 'null'
          description: Email address of the user
          title: User Email
        direct_team_role:
          anyOf:
            - $ref: '#/components/schemas/TeamRoleV1'
            - type: 'null'
          description: >-
            Team role given to the user on this team; null when their access
            comes only from a directory group or from being an organization
            admin. Temporary; may be removed once fine-grained access control is
            available.
        effective_team_role:
          $ref: '#/components/schemas/TeamEffectiveRoleV1'
          description: >-
            Team role that applies: the strongest of the direct team role and
            the user's directory groups' team roles on this team, or `ADMIN` for
            an organization admin. Temporary; may be removed once fine-grained
            access control is available.
      required:
        - team_id
        - team_name
        - user_id
        - user_name
        - user_email
        - direct_team_role
        - effective_team_role
      title: TeamUserV1
      type: object
    PaginationResponseV1:
      properties:
        has_more:
          description: Whether more items exist after this page.
          title: Has More
          type: boolean
        cursor:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: >-
            Opaque cursor to pass into the next request. Null when there is no
            next page.
          title: Cursor
      required:
        - has_more
      title: PaginationResponseV1
      type: object
    TeamRoleV1:
      description: |-
        A team role a user can be given.

        Temporary; may be removed once fine-grained access control is available.
      enum:
        - TEAM_VIEWER
        - TEAM_MEMBER
        - TEAM_ADMIN
      title: TeamRoleV1
      type: string
    TeamEffectiveRoleV1:
      description: >-
        The team role that applies to a user, or `ADMIN` for an organization
        admin.


        Temporary; may be removed once fine-grained access control is available.
      enum:
        - TEAM_VIEWER
        - TEAM_MEMBER
        - TEAM_ADMIN
        - ADMIN
      title: TeamEffectiveRoleV1
      type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````