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

# List teamspace users

> Retrieve a list of users in the specified teamspace.



## OpenAPI

````yaml get /organization/teamspaces/{teamspace_id}/users
openapi: 3.0.3
info:
  version: 0.1.1
  title: Datagrid API
  description: Datagrid API
servers:
  - url: https://api.datagrid.com/v1
security:
  - BearerAuth: []
paths:
  /organization/teamspaces/{teamspace_id}/users:
    get:
      tags:
        - Teamspace Users
      summary: List teamspace users
      description: Retrieve a list of users in the specified teamspace.
      operationId: Users.listTeamspaceUsers
      parameters:
        - name: teamspace_id
          in: path
          required: true
          schema:
            type: string
          description: The ID of the teamspace
        - name: search
          in: query
          schema:
            type: string
          required: false
          description: Search term to filter users by name or email
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/after'
        - $ref: '#/components/parameters/before'
      responses:
        '200':
          description: List of users in the teamspace
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTeamspaceUsers'
        '429':
          description: >-
            Rate limit exceeded. The request has been throttled because the rate
            limit for this endpoint has been reached. Check the `Retry-After`
            response header and retry after the specified number of seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitError'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Datagrid from 'datagrid-ai';


            const client = new Datagrid({
              apiKey: process.env['DATAGRID_API_KEY'], // This is the default and can be omitted
            });


            // Automatically fetches more pages as needed.

            for await (const teamspaceUser of
            client.organization.teamspaces.users.list('teamspace_id')) {
              console.log(teamspaceUser.id);
            }
        - lang: Python
          source: |-
            import os
            from datagrid_ai import Datagrid

            client = Datagrid(
                api_key=os.environ.get("DATAGRID_API_KEY"),  # This is the default and can be omitted
            )
            page = client.organization.teamspaces.users.list(
                teamspace_id="teamspace_id",
            )
            page = page.data[0]
            print(page.id)
components:
  parameters:
    limit:
      name: limit
      in: query
      schema:
        type: integer
        default: 50
        minimum: 1
        maximum: 100
      required: false
      description: The limit on the number of objects to return, ranging between 1 and 100.
    after:
      name: after
      in: query
      schema:
        type: string
      required: false
      description: >-
        A cursor to use in pagination. `after` is an object ID that defines your
        place in the list. For example, if you make a list request and receive
        100 objects, ending with `obj_foo`, your subsequent call can include
        `after=obj_foo` to fetch the next page of the list.
    before:
      name: before
      in: query
      schema:
        type: string
      required: false
      description: >-
        A cursor to use in pagination. `before` is an object ID that defines
        your place in the list. For example, if you make a list request and
        receive 100 objects, starting with `obj_bar`, your subsequent call can
        include `before=obj_bar` to fetch the previous page of the list.
  schemas:
    ListTeamspaceUsers:
      type: object
      description: Response containing a list of users in a teamspace
      required:
        - object
        - data
      properties:
        object:
          type: string
          enum:
            - list
        data:
          type: array
          items:
            $ref: '#/components/schemas/TeamspaceUser'
          description: An array containing the actual response elements.
        has_more:
          type: boolean
          description: >-
            Whether or not there are more elements available after this set. If
            false, this set comprises the end of the list.
    RateLimitError:
      type: object
      description: >-
        Returned when the rate limit is exceeded. Rate limits are enforced per
        teamspace, endpoint path, and HTTP method over a 60-second sliding
        window. Each endpoint may have its own limit — check the
        X-RateLimit-Limit response header for the effective value.
      required:
        - error
        - message
        - retryable
        - status_code
      properties:
        status_code:
          type: integer
          description: The HTTP status code (429).
        statusCode:
          type: integer
          deprecated: true
          description: Deprecated. Use status_code instead.
        error:
          type: string
          enum:
            - rate_limit_exceeded
          description: The error code identifying this as a rate limit error.
        message:
          type: string
          description: A human-readable error message.
        mitigation:
          type: string
          description: Suggested action to resolve the error.
        retryable:
          type: boolean
          description: Whether the request can be retried after a delay.
        details:
          type: object
          properties:
            reason:
              type: string
              description: A detailed explanation of why the rate limit was exceeded.
    TeamspaceUser:
      type: object
      description: Represents a user in a teamspace
      required:
        - id
        - email
        - first_name
        - last_name
        - permissions
      properties:
        id:
          type: string
          description: The unique identifier of the user
        email:
          type: string
          format: email
          description: The email address of the user
        first_name:
          type: string
          description: The first name of the user
        last_name:
          type: string
          description: The last name of the user
        permissions:
          $ref: '#/components/schemas/TeamspaceUserPermissions'
          description: The permissions assigned to the user in the teamspace
    TeamspaceUserPermissions:
      type: object
      description: Represents a permission assigned to a user
      required:
        - role
      properties:
        role:
          type: string
          enum:
            - owner
            - admin
            - member
            - collaborator
            - agents-only
            - agent-specific
          description: >
            The role assigned to the user. Available roles:

            - **owner**: Creator of the teamspace. Full control over the
            teamspace. Can manage all users, settings, and resources.

            - **admin**: Full control over the teamspace. Can manage all users,
            settings, and resources.

            - **member**: Standard member access. Can view and interact with
            teamspace resources. Can invite other members.

            - **collaborator**: Read-only access with ability to comment and
            provide feedback.

            - **agents-only**: Access limited to AI agent interactions within
            the teamspace.

            - **agent-specific**: Limited access on teamspace level, can only
            access agents that are assigned to the teamspace.
        agent_ids:
          type: array
          nullable: true
          items:
            type: string
          description: >-
            The agent IDs that the user has access to, if the role is
            agent-specific.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````