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

Canonical page: https://docs.99digital.co.il/online-api/webhooks/conversation-events

# Conversation Events

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

Online sends a conversation event to your webhook when a conversation is created, its status changes, or it changes in any other way.

| Subscription | Sent when |
| --- | --- |
| `conversation_created` | A conversation is created. |
| `conversation_status_changed` | A conversation's status changes (Bot, Manual, snoozed or resolved). |
| `conversation_updated` | A conversation changes — assignee, team, labels, custom attributes, priority, … Includes `changed_attributes`, and also `sender`. |

The payload is the conversation's fields, at the top level.
`changed_attributes` lists the changes, for example
`[{"status": {"previous_value": "open", "current_value": "resolved"}}]`.
The event is sent only if its inbox is in the webhook's `inbox_ids`, or
`inbox_ids` is empty.

**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** — `conversation_status_changed` (the last message is shortened):

```json
{
  "event": "conversation_status_changed",
  "id": 1501,
  "inbox_id": 31,
  "channel": "Channel::Api",
  "status": "resolved",
  "priority": null,
  "labels": [
    "vip"
  ],
  "custom_attributes": {},
  "additional_attributes": {},
  "contact_inbox": {
    "source_id": "5f0c1a2b-3c4d-4e5f-8a9b-0c1d2e3f4a5b"
  },
  "messages": [
    {
      "id": 40114,
      "content": "Your order A-1001 is ready for pickup.",
      "message_type": 1
    }
  ],
  "meta": {
    "sender": {
      "id": 801,
      "name": "Dana Cohen",
      "type": "contact"
    },
    "assignee": null,
    "team": null,
    "hmac_verified": false
  },
  "unread_count": 0,
  "snoozed_until": null,
  "waiting_since": 0,
  "last_activity_at": 1794474000,
  "agent_last_seen_at": 1794473900,
  "contact_last_seen_at": 0,
  "assignee_last_seen_at": 0,
  "timestamp": 1794474000,
  "created_at": 1794470400,
  "changed_attributes": [
    {
      "status": {
        "previous_value": "open",
        "current_value": "resolved"
      }
    }
  ],
  "allow_unverified_ssl": false
}
```

### Payload explained

| Parameter | Description / Example |
| --- | --- |
| `event` | What happened. See the values below. |
| `id` | The conversation's display ID. |
| `inbox_id` | The inbox ID. |
| `channel` | The inbox's channel type, for example `Channel::Api`. |
| `status` | The status. The dashboard calls `open` **Bot** and `pending` **Manual**. See the values below. |
| `priority` | The priority, or `null`. |
| `labels` | The titles of the conversation's labels. |
| `custom_attributes` | The conversation's custom attributes. |
| `additional_attributes` | Channel or system data of the conversation. |
| `contact_inbox` | The contact's link to the inbox. |
| `messages` | The conversation's last message. |
| `meta` | The conversation's people. |
| `unread_count` | Incoming messages the agents have not read. |
| `snoozed_until` | When a snoozed conversation reopens, or `null`. |
| `waiting_since` | Since when the contact has been waiting for a reply (Unix time, seconds), or `0`. |
| `last_activity_at` | The last activity (Unix time, seconds). |
| `agent_last_seen_at` | When an agent last read the conversation (Unix time, seconds), or `0`. |
| `contact_last_seen_at` | When the contact last read the conversation (Unix time, seconds), or `0`. |
| `assignee_last_seen_at` | When the assignee last read the conversation (Unix time, seconds), or `0`. |
| `timestamp` | The same as `last_activity_at`. |
| `created_at` | When the conversation was created (Unix time, seconds). |
| `changed_attributes` | What changed: one object per attribute, keyed by its name, with its `previous_value` and `current_value`. |
| `sender` | Included with `conversation_updated`. |
| `allow_unverified_ssl` | Added by Online to every payload. |

#### `event`

| Value | Explanation |
| --- | --- |
| conversation_created | A conversation was created. |
| conversation_status_changed | The conversation's status changed. |
| conversation_updated | The conversation changed — assignee, team, labels, custom attributes, priority, … |

#### `status`

| Value | Explanation |
| --- | --- |
| open | Bot — handled by the bot or automation. |
| pending | Manual — handled by a human agent. |
| snoozed | Hidden until it is reopened. |
| resolved | Closed. |

## Webhook payload

Content type: `application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `event` | string | Yes | What happened. One of: `conversation_created` — A conversation was created; `conversation_status_changed` — The conversation's status changed; `conversation_updated` — The conversation changed — assignee, team, labels, custom attributes, priority, …. |
| `id` | integer | No | The conversation's display ID. |
| `inbox_id` | integer | No | The inbox ID. |
| `channel` | string | No | The inbox's channel type, for example `Channel::Api`. |
| `status` | string | No | The status. The dashboard calls `open` **Bot** and `pending` **Manual**. One of: `open` — Bot — handled by the bot or automation; `pending` — Manual — handled by a human agent; `snoozed` — Hidden until it is reopened; `resolved` — Closed. |
| `priority` | string \| null | No | The priority, or `null`. One of: `low`, `medium`, `high`, `urgent`, `null`. |
| `labels` | array of string | No | The titles of the conversation's labels. |
| `custom_attributes` | object | No | The conversation's custom attributes. |
| `additional_attributes` | object | No | Channel or system data of the conversation. |
| `contact_inbox` | object | No | The contact's link to the inbox. |
| `contact_inbox.source_id` | string | No | The contact's ID on the inbox's channel. |
| `messages` | array of object | No | The conversation's last message. |
| `messages[].id` | integer | No | The message ID. |
| `messages[].content` | string \| null | No | The text. |
| `messages[].message_type` | integer | No | Who the message is from, as a number: `0` incoming, `1` outgoing, `2` activity, `3` template. One of: `0`, `1`, `2`, `3`. |
| `meta` | object | No | The conversation's people. |
| `meta.sender` | object | No | The contact, as `{id, name, type}`. |
| `meta.sender.id` | integer | No |  |
| `meta.sender.name` | string | No |  |
| `meta.sender.type` | string | No |  |
| `meta.assignee` | object \| null | No | The assigned agent, or `null`. |
| `meta.team` | object \| null | No | The assigned team, or `null`. |
| `meta.hmac_verified` | boolean | No | Whether the contact's identity was HMAC-verified (website widget). |
| `unread_count` | integer | No | Incoming messages the agents have not read. |
| `snoozed_until` | any | No | When a snoozed conversation reopens, or `null`. |
| `waiting_since` | integer | No | Since when the contact has been waiting for a reply (Unix time, seconds), or `0`. |
| `last_activity_at` | integer | No | The last activity (Unix time, seconds). |
| `agent_last_seen_at` | integer | No | When an agent last read the conversation (Unix time, seconds), or `0`. |
| `contact_last_seen_at` | integer | No | When the contact last read the conversation (Unix time, seconds), or `0`. |
| `assignee_last_seen_at` | integer | No | When the assignee last read the conversation (Unix time, seconds), or `0`. |
| `timestamp` | integer | No | The same as `last_activity_at`. |
| `created_at` | integer | No | When the conversation was created (Unix time, seconds). |
| `changed_attributes` | array of object | No | What changed: one object per attribute, keyed by its name, with its `previous_value` and `current_value`. |
| `sender` | object | No | Included with `conversation_updated`. |
| `allow_unverified_ssl` | boolean | Yes | Added by Online to every payload. |

### Example (generated from the schema)

```json
{
  "event": "conversation_status_changed",
  "id": 1501,
  "inbox_id": 31,
  "channel": "Channel::Api",
  "status": "resolved",
  "priority": null,
  "labels": [
    "vip"
  ],
  "custom_attributes": {},
  "additional_attributes": {},
  "contact_inbox": {
    "source_id": "5f0c1a2b-3c4d-4e5f-8a9b-0c1d2e3f4a5b"
  },
  "messages": [
    {
      "id": 40114,
      "content": "Your order A-1001 is ready for pickup.",
      "message_type": 1
    }
  ],
  "meta": {
    "sender": {
      "id": 801,
      "name": "Dana Cohen",
      "type": "contact"
    },
    "assignee": null,
    "team": null,
    "hmac_verified": false
  },
  "unread_count": 0,
  "snoozed_until": null,
  "waiting_since": 0,
  "last_activity_at": 1794474000,
  "agent_last_seen_at": 1794473900,
  "contact_last_seen_at": 0,
  "assignee_last_seen_at": 0,
  "timestamp": 1794474000,
  "created_at": 1794470400,
  "changed_attributes": [
    {
      "status": {
        "previous_value": "open",
        "current_value": "resolved"
      }
    }
  ],
  "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.
