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

Canonical page: https://docs.99digital.co.il/online-api/webhooks/agent-status-changed

# Agent Status Changed

**Webhook.** Sent to the webhook URL you configure.

Online sends `agent_status_changed` to your webhook when an agent's availability changed (online, busy or offline).

| Subscription | Sent when |
| --- | --- |
| `agent_status_changed` | An agent's availability changed (online, busy or offline). |

This event is account-wide: it is sent for every inbox, whatever the
webhook's `inbox_ids`.

**Settings:**

| Setting | Value |
| --- | --- |
| URL | Your webhook URL — create the webhook with [Add Webhook](https://docs.99digital.co.il/online-api/webhooks/add-webhook) and choose its events in `subscriptions` |
| Method | JSON via POST |

**Example** (`agent` is shortened):

```json
{
  "event": "agent_status_changed",
  "occurred_at": 1794471000,
  "account": {
    "id": 12,
    "name": "Example Account"
  },
  "agent": {
    "id": 53,
    "name": "Omer Katz"
  },
  "status_change": {
    "previous_status": "online",
    "new_status": "busy"
  },
  "allow_unverified_ssl": false
}
```

### Payload explained

| Parameter | Description / Example |
| --- | --- |
| `event` | An agent's availability changed. |
| `occurred_at` | When it happened. |
| `account` | The account. |
| `agent` | The agent. |
| `status_change` | The availability before and after the change. |
| `allow_unverified_ssl` | Added by Online to every payload. |

## Webhook payload

Content type: `application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `event` | string | Yes | An agent's availability changed. Always `agent_status_changed`. |
| `occurred_at` | integer | No | When it happened. |
| `account` | object | No | The account. |
| `account.id` | integer | No | The account ID. |
| `account.name` | string | No | The account name. |
| `agent` | object | No | The agent. |
| `status_change` | object | No | The availability before and after the change. |
| `status_change.previous_status` | string | No | The availability before the change. One of: `online`, `busy`, `offline`. |
| `status_change.new_status` | string | No | The availability after the change. One of: `online`, `busy`, `offline`. |
| `allow_unverified_ssl` | boolean | Yes | Added by Online to every payload. |

### Example (generated from the schema)

```json
{
  "event": "agent_status_changed",
  "occurred_at": 1794471000,
  "account": {
    "id": 12,
    "name": "Example Account"
  },
  "agent": {
    "id": 53,
    "name": "Omer Katz"
  },
  "status_change": {
    "previous_status": "online",
    "new_status": "busy"
  },
  "allow_unverified_ssl": false
}
```

## Responses

### 200 — Answer with any `2xx` status within 5 seconds. Online ignores the body of your answer, and does not send the event again.
