> ## 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 and Retrieve Workspace Members via ChatbotX API

> List all members in your ChatbotX workspace or retrieve a single member by ID, including their role, permissions, and profile details.

Workspace members are the agents and administrators who have access to your ChatbotX workspace. This page covers two endpoints: listing all members in the workspace (with pagination and keyword search) and fetching a single member by their unique ID. Each member record includes their user profile, role, and granular permission settings.

***

## List Workspace Members

Retrieve a paginated list of all members in your workspace.

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

### Query Parameters

<ParamField query="page" type="integer">
  The page number to retrieve. Must be `1` or greater.
</ParamField>

<ParamField query="perPage" type="integer">
  Number of members to return per page. Must be `1` or greater.
</ParamField>

<ParamField query="keyword" type="string">
  Filter members by name or email address.
</ParamField>

### Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://app.chatbotx.io/api/v1/members?page=1&perPage=20' \
    --header 'Authorization: Bearer <token>'
  ```

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

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

  params = {"page": 1, "perPage": 20}
  headers = {"Authorization": "Bearer <token>"}

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

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

  fetch('https://app.chatbotx.io/api/v1/members?page=1&perPage=20', 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 member objects and a `pageCount`.

<ResponseField name="data" type="array" required>
  Array of workspace member objects.

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

    <ResponseField name="workspaceId" type="string" required>
      The ID of the workspace this membership belongs to.
    </ResponseField>

    <ResponseField name="userId" type="string" required>
      The ID of the user account associated with this member.
    </ResponseField>

    <ResponseField name="permissions" type="object" required>
      Granular permission flags for the member. Includes `superAdmin`, `analytics`, `flows`, `contacts`, `onlyAssignedContacts`, `emailAndPhone`, `broadcast`, and `ecommerce`.
    </ResponseField>

    <ResponseField name="user" type="object" required>
      The user's profile details including `id`, `name`, and `image`.
    </ResponseField>

    <ResponseField name="createdAt" type="string" required>
      ISO 8601 timestamp for when the member was added to the workspace.
    </ResponseField>

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

<ResponseField name="pageCount" type="number" required>
  Total number of pages available for the current `perPage` value.
</ResponseField>

#### Example Response

```json theme={null}
{
  "data": [
    {
      "id": "mem_001",
      "workspaceId": "42",
      "userId": "usr_agent_01",
      "permissions": {
        "superAdmin": false,
        "analytics": true,
        "flows": true,
        "contacts": true,
        "onlyAssignedContacts": false,
        "emailAndPhone": true,
        "broadcast": true,
        "ecommerce": false
      },
      "user": {
        "id": "usr_agent_01",
        "name": "Jane Smith",
        "image": "https://cdn.chatbotx.io/avatars/jane.png"
      },
      "createdAt": "2023-06-01T08:00:00Z",
      "updatedAt": "2024-01-10T09:30:00Z"
    }
  ],
  "pageCount": 2
}
```

***

## Get Member by ID

Retrieve the full profile and permissions for a single workspace member.

<Info>
  **GET** `/api/v1/members/{memberId}`
</Info>

### Path Parameters

<ParamField path="memberId" type="string" required>
  The numeric ID of the workspace member to retrieve. Must match the pattern `\d+`.
</ParamField>

### Code Examples

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

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

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

  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/members/mem_001', options)
    .then(res => res.json())
    .then(res => console.log(res))
    .catch(err => console.error(err));
  ```
</CodeGroup>

### Response

Returns `200 OK` with a single member object.

<ResponseField name="id" type="string" required>
  Unique identifier for the workspace membership record.
</ResponseField>

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

<ResponseField name="userId" type="string" required>
  The associated user account ID.
</ResponseField>

<ResponseField name="role" type="string" required>
  The member's role in the workspace. One of `owner` or `agent`.
</ResponseField>

<ResponseField name="permissions" type="object" required>
  Granular permission flags. Includes `superAdmin`, `analytics`, `flows`, `contacts`, `onlyAssignedContacts`, `emailAndPhone`, `broadcast`, and `ecommerce`.
</ResponseField>

<ResponseField name="user" type="object" required>
  The user's profile including `id`, `name`, and `image`.
</ResponseField>

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

<ResponseField name="updatedAt" type="string" required>
  ISO 8601 timestamp for when the member record was last modified.
</ResponseField>

#### Example Response

```json theme={null}
{
  "id": "mem_001",
  "workspaceId": "42",
  "userId": "usr_agent_01",
  "role": "agent",
  "permissions": {
    "superAdmin": false,
    "analytics": true,
    "flows": true,
    "contacts": true,
    "onlyAssignedContacts": false,
    "emailAndPhone": true,
    "broadcast": true,
    "ecommerce": false
  },
  "user": {
    "id": "usr_agent_01",
    "name": "Jane Smith",
    "image": "https://cdn.chatbotx.io/avatars/jane.png"
  },
  "createdAt": "2023-06-01T08:00:00Z",
  "updatedAt": "2024-01-10T09:30:00Z"
}
```
