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

# List Workspace Agent Teams via the ChatbotX REST API

> Use GET /api/v1/teams to retrieve all agent teams in your ChatbotX workspace, including each team's name, membership list, and user profile details.

Teams in ChatbotX let you group agents together so they can be assigned to conversations collectively. Use this endpoint to list all teams in your workspace. Each team record includes its members along with their user profile details, making it easy to understand your support team structure programmatically.

<Info>
  **GET** `/api/v1/teams`
</Info>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://app.chatbotx.io/api/v1/teams \
    --header 'Authorization: Bearer <token>'
  ```

  ```python Python theme={null}
  import requests

  url = "https://app.chatbotx.io/api/v1/teams"

  headers = {"Authorization": "Bearer <token>"}

  response = requests.get(url, headers=headers)
  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const options = {
    method: 'GET',
    headers: { Authorization: 'Bearer <token>' }
  };

  fetch('https://app.chatbotx.io/api/v1/teams', options)
    .then(res => res.json())
    .then(res => console.log(res))
    .catch(err => console.error(err));
  ```
</CodeGroup>

## Response

Returns `200 OK` with a `data` array of team objects.

### Response Fields

<ResponseField name="data" type="array" required>
  Array of team objects in the workspace.

  <Expandable title="data item fields">
    <ResponseField name="id" type="string" required>
      Unique identifier for the team.
    </ResponseField>

    <ResponseField name="name" type="string" required>
      Display name of the team.
    </ResponseField>

    <ResponseField name="workspaceId" type="string" required>
      The workspace this team belongs to.
    </ResponseField>

    <ResponseField name="inboxTeamMembers" type="array" required>
      Array of team membership records, each containing:

      * `id` — unique membership record ID
      * `inboxTeamId` — the team this record belongs to
      * `userId` — the ID of the user
      * `user` — the user's full profile, including `id`, `name`, `email`, `image`, `emailVerified`, and `isAnonymous`
    </ResponseField>

    <ResponseField name="createdAt" type="string" required>
      ISO 8601 timestamp for when the team was created.
    </ResponseField>

    <ResponseField name="updatedAt" type="string" required>
      ISO 8601 timestamp for when the team was last updated.
    </ResponseField>
  </Expandable>
</ResponseField>

### Example Response

```json theme={null}
{
  "data": [
    {
      "id": "team_001",
      "name": "Technical Support",
      "workspaceId": "42",
      "createdAt": "2023-03-10T07:00:00Z",
      "updatedAt": "2024-02-01T11:00:00Z",
      "inboxTeamMembers": [
        {
          "id": "tm_001",
          "inboxTeamId": "team_001",
          "userId": "usr_agent_01",
          "user": {
            "id": "usr_agent_01",
            "name": "Jane Smith",
            "email": "jane@acme.com",
            "image": "https://cdn.chatbotx.io/avatars/jane.png",
            "emailVerified": true,
            "isAnonymous": false,
            "createdAt": "2023-01-20T08:00:00Z",
            "updatedAt": "2024-01-10T09:30:00Z"
          }
        }
      ]
    }
  ]
}
```
