<!-- Generated from the canonical 99 Digital API documentation. Do not edit this file. -->

Canonical page: https://docs.99digital.co.il/online-api/agents/list-online-agents

# List Online Agents

`GET https://online.99digital.co.il/api/v1/accounts/{account_id}/agents/online`

Returns the IDs of agents who are currently online in the account.

Optionally filters to the members of one team. Useful for bots that decide
whether to hand a conversation over to a human.

| Setting | Value |
| --- | --- |
| **Method** | `GET` |
| **Path** | `/api/v1/accounts/{account_id}/agents/online` |
| **Authorization** | User token (any agent) **or agent-bot token**. |

**Path parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `account_id` | integer | Yes | Account ID. |

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `team_id` | integer | No | Return only online agents who are members of this team. `404` if the team does not exist. |

**Example: all online agents**

```bash
curl -X GET 'https://online.99digital.co.il/api/v1/accounts/12/agents/online' \
  -H 'api_access_token: <YOUR_API_ACCESS_TOKEN>'
```

Response (`200 OK`). The IDs are strings.

```json
["51", "52", "53"]
```

**Example: online agents of a team**

```bash
curl -X GET 'https://online.99digital.co.il/api/v1/accounts/12/agents/online?team_id=7' \
  -H 'api_access_token: <YOUR_API_ACCESS_TOKEN>'
```

Response (`200 OK`):

```json
["51"]
```

## Authentication

`api_access_token` in the header — Your access token. A user token is in the dashboard under **Profile settings → Access Token**, and grants exactly what that agent's role allows. An agent-bot token may call only the endpoints marked for agent bots. See [Getting Started](https://docs.99digital.co.il/online-api/getting-started#authentication).

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `account_id` | path | integer | Yes | The numeric ID of your account: the number after `/app/accounts/` in the dashboard URL. Example: `12`. |
| `team_id` | query | integer | No | Return only the online agents who are members of this team. A team that does not exist returns `404`. Example: `7`. |

## Responses

### 200 — The user IDs of the online agents, as strings.

Content type: `application/json`

Type: `array of string`.

#### Example: Online agents

One agent is online.

```json
[
  "51"
]
```

#### Example: Nobody online

No agent (or no member of the team) is online.

```json
[]
```

### 401 — The access token is missing or wrong, or its user does not belong to this account.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | The error message. |

#### Example: Invalid token

The api_access_token header is missing or wrong.

```json
{
  "error": "Invalid Access Token"
}
```

#### Example: Another account

A valid token, for a user who is not in this account.

```json
{
  "error": "You are not authorized to access this account"
}
```

### 404 — The team in `team_id` does not exist in this account.

Content type: `application/json`

| Field | Type | Description |
| --- | --- | --- |
| `error` | string | The error message. |

#### Example

```json
{
  "error": "Resource could not be found"
}
```
