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

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

# Message Events

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

Online sends a message event to your webhook when a message is created or changed, or when the contact answers a CSAT survey.

| Subscription | Sent when | `event` in the payload |
| --- | --- | --- |
| `message_created_customer` | The contact sent a message (`message_type` `incoming`). | `message_created` |
| `message_created_agent` | An agent or an API user sent a message. | `message_created` |
| `message_created_bot` | An agent bot sent a message. | `message_created` |
| `message_updated` | A message changed — status, content, deletion, … | `message_updated` |
| `csat_survey_submitted` | The contact answered a CSAT survey. | `csat_survey_submitted` |

The three `message_created_*` subscriptions all deliver a payload with
`"event": "message_created"`: subscribe to each source you need.
`message_created` itself is **not** a valid subscription. 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** — `message_created`, a customer message (the conversation's last message is shortened):

```json
{
  "event": "message_created",
  "id": 40113,
  "content": "Hi, where is my order?",
  "content_type": "text",
  "content_attributes": {},
  "additional_attributes": {},
  "message_type": "incoming",
  "private": false,
  "source_id": null,
  "created_at": "2026-11-12T08:05:00.000Z",
  "account": {
    "id": 12,
    "name": "Example Account"
  },
  "inbox": {
    "id": 31,
    "name": "Website API"
  },
  "sender": {
    "type": "contact",
    "id": 801,
    "name": "Dana Cohen",
    "email": "dana.cohen@example.com",
    "phone_number": "+972501234567",
    "identifier": "crm-801",
    "additional_attributes": {
      "company_name": "Example Ltd",
      "city": "Tel Aviv"
    },
    "custom_attributes": {
      "customer_tier": "gold"
    },
    "avatar": "",
    "thumbnail": "",
    "account": {
      "id": 12,
      "name": "Example Account"
    }
  },
  "conversation": {
    "id": 1501,
    "inbox_id": 31,
    "channel": "Channel::Api",
    "status": "open",
    "priority": null,
    "labels": [
      "vip"
    ],
    "custom_attributes": {},
    "additional_attributes": {},
    "contact_inbox": {
      "source_id": "5f0c1a2b-3c4d-4e5f-8a9b-0c1d2e3f4a5b"
    },
    "messages": [
      {
        "id": 40113,
        "content": "Hi, where is my order?",
        "message_type": 0
      }
    ],
    "meta": {
      "sender": {
        "id": 801,
        "name": "Dana Cohen",
        "type": "contact"
      },
      "assignee": null,
      "team": null,
      "hmac_verified": false
    },
    "unread_count": 1,
    "snoozed_until": null,
    "waiting_since": 1794470700,
    "last_activity_at": 1794470700,
    "agent_last_seen_at": 0,
    "contact_last_seen_at": 0,
    "assignee_last_seen_at": 0,
    "timestamp": 1794470700,
    "created_at": 1794470400
  },
  "allow_unverified_ssl": false
}
```

### Payload explained

| Parameter | Description / Example |
| --- | --- |
| `event` | What happened. See the values below. |
| `id` | The message ID. |
| `content` | The text. |
| `content_type` | The kind of content — `text` unless the message is interactive. The values are those of the message object (see [List of Messages](https://docs.99digital.co.il/online-api/messages/list-of-messages)). |
| `content_attributes` | Data for the content type, as in the message object. |
| `additional_attributes` | Extra data of the message. |
| `message_type` | Who the message is from, as a word. See the values below. |
| `private` | `true` for a private note: seen by agents only, never sent to the contact. |
| `source_id` | The message's ID on the external channel, or `null`. |
| `created_at` | When the message was created (ISO 8601, with milliseconds). |
| `account` | The account. |
| `inbox` | The inbox. |
| `sender` | Who sent the message. The fields listed are a contact's (`type` `contact`). |
| `conversation` | The conversation the message belongs to. |
| `allow_unverified_ssl` | Added by Online to every payload. |

#### `event`

| Value | Explanation |
| --- | --- |
| message_created | A message was created. Sent for the sources you subscribed to: `message_created_customer`, `message_created_agent`, `message_created_bot`. |
| message_updated | A message changed — status, content, deletion, … |
| csat_survey_submitted | The contact answered a CSAT survey. |

#### `message_type`

| Value | Explanation |
| --- | --- |
| incoming | From the contact. |
| outgoing | From an agent, a bot or the API. |
| activity | A system note, such as "Conversation was resolved". |
| template | A template message. |

## Webhook payload

Content type: `application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `event` | string | Yes | What happened. One of: `message_created` — A message was created. Sent for the sources you subscribed to: `message_created_customer`, `message_created_agent`, `message_created_bot`; `message_updated` — A message changed — status, content, deletion, …; `csat_survey_submitted` — The contact answered a CSAT survey. |
| `id` | integer | No | The message ID. |
| `content` | string \| null | No | The text. |
| `content_type` | string | No | The kind of content — `text` unless the message is interactive. The values are those of the message object (see [List of Messages](https://docs.99digital.co.il/online-api/messages/list-of-messages)). |
| `content_attributes` | object | No | Data for the content type, as in the message object. |
| `additional_attributes` | object | No | Extra data of the message. |
| `message_type` | string | No | Who the message is from, as a word. One of: `incoming` — From the contact; `outgoing` — From an agent, a bot or the API; `activity` — A system note, such as "Conversation was resolved"; `template` — A template message. |
| `private` | boolean | No | `true` for a private note: seen by agents only, never sent to the contact. |
| `source_id` | string \| null | No | The message's ID on the external channel, or `null`. |
| `created_at` | string | No | When the message was created (ISO 8601, with milliseconds). |
| `account` | object | No | The account. |
| `account.id` | integer | No | The account ID. |
| `account.name` | string | No | The account name. |
| `inbox` | object | No | The inbox. |
| `inbox.id` | integer | No | The inbox ID. |
| `inbox.name` | string | No | The inbox name. |
| `sender` | object | No | Who sent the message. The fields listed are a contact's (`type` `contact`). |
| `sender.type` | string | No | The kind of sender — `user` is an agent. One of: `contact`, `user`, `agent_bot`. |
| `sender.id` | integer | No | The ID of the contact, agent or agent bot. |
| `sender.name` | string | No | The name. |
| `sender.email` | string \| null | No | The email. |
| `sender.phone_number` | string \| null | No | The phone number in E.164 format. |
| `sender.identifier` | string \| null | No | Your own external ID for the contact. |
| `sender.additional_attributes` | object | No | The contact's additional attributes. |
| `sender.custom_attributes` | object | No | The contact's custom attributes. |
| `sender.avatar` | string | No | The avatar URL, or an empty string. |
| `sender.thumbnail` | string | No | The avatar thumbnail URL, or an empty string. |
| `sender.account` | object | No | The account, as `{id, name}`. |
| `sender.account.id` | integer | No |  |
| `sender.account.name` | string | No |  |
| `conversation` | object | No | The conversation the message belongs to. |
| `conversation.id` | integer | No | The conversation's display ID. |
| `conversation.inbox_id` | integer | No | The inbox ID. |
| `conversation.channel` | string | No | The inbox's channel type, for example `Channel::Api`. |
| `conversation.status` | string | No | The status. The dashboard calls `open` **Bot** and `pending` **Manual**. One of: `open`, `pending`, `snoozed`, `resolved`. |
| `conversation.priority` | string \| null | No | The priority, or `null`. One of: `low`, `medium`, `high`, `urgent`, `null`. |
| `conversation.labels` | array of string | No | The titles of the conversation's labels. |
| `conversation.custom_attributes` | object | No | The conversation's custom attributes. |
| `conversation.additional_attributes` | object | No | Channel or system data of the conversation. |
| `conversation.contact_inbox` | object | No | The contact's link to the inbox. |
| `conversation.contact_inbox.source_id` | string | No | The contact's ID on the inbox's channel. |
| `conversation.messages` | array of object | No | The conversation's last message. |
| `conversation.messages[].id` | integer | No | The message ID. |
| `conversation.messages[].content` | string \| null | No | The text. |
| `conversation.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`. |
| `conversation.meta` | object | No | The conversation's people. |
| `conversation.meta.sender` | object | No | The contact, as `{id, name, type}`. |
| `conversation.meta.sender.id` | integer | No |  |
| `conversation.meta.sender.name` | string | No |  |
| `conversation.meta.sender.type` | string | No |  |
| `conversation.meta.assignee` | object \| null | No | The assigned agent, or `null`. |
| `conversation.meta.team` | object \| null | No | The assigned team, or `null`. |
| `conversation.meta.hmac_verified` | boolean | No | Whether the contact's identity was HMAC-verified (website widget). |
| `conversation.unread_count` | integer | No | Incoming messages the agents have not read. |
| `conversation.snoozed_until` | any | No | When a snoozed conversation reopens, or `null`. |
| `conversation.waiting_since` | integer | No | Since when the contact has been waiting for a reply (Unix time, seconds), or `0`. |
| `conversation.last_activity_at` | integer | No | The last activity (Unix time, seconds). |
| `conversation.agent_last_seen_at` | integer | No | When an agent last read the conversation (Unix time, seconds), or `0`. |
| `conversation.contact_last_seen_at` | integer | No | When the contact last read the conversation (Unix time, seconds), or `0`. |
| `conversation.assignee_last_seen_at` | integer | No | When the assignee last read the conversation (Unix time, seconds), or `0`. |
| `conversation.timestamp` | integer | No | The same as `last_activity_at`. |
| `conversation.created_at` | integer | No | When the conversation was created (Unix time, seconds). |
| `allow_unverified_ssl` | boolean | Yes | Added by Online to every payload. |

### Example (generated from the schema)

```json
{
  "event": "message_created",
  "id": 40113,
  "content": "Hi, where is my order?",
  "content_type": "text",
  "content_attributes": {},
  "additional_attributes": {},
  "message_type": "incoming",
  "private": false,
  "source_id": null,
  "created_at": "2026-11-12T08:05:00.000Z",
  "account": {
    "id": 12,
    "name": "Example Account"
  },
  "inbox": {
    "id": 31,
    "name": "Website API"
  },
  "sender": {
    "type": "contact",
    "id": 801,
    "name": "Dana Cohen",
    "email": "dana.cohen@example.com",
    "phone_number": "+972501234567",
    "identifier": "crm-801",
    "additional_attributes": {
      "company_name": "Example Ltd",
      "city": "Tel Aviv"
    },
    "custom_attributes": {
      "customer_tier": "gold"
    },
    "avatar": "",
    "thumbnail": "",
    "account": {
      "id": 12,
      "name": "Example Account"
    }
  },
  "conversation": {
    "id": 1501,
    "inbox_id": 31,
    "channel": "Channel::Api",
    "status": "open",
    "priority": null,
    "labels": [
      "vip"
    ],
    "custom_attributes": {},
    "additional_attributes": {},
    "contact_inbox": {
      "source_id": "5f0c1a2b-3c4d-4e5f-8a9b-0c1d2e3f4a5b"
    },
    "messages": [
      {
        "id": 40113,
        "content": "Hi, where is my order?",
        "message_type": 0
      }
    ],
    "meta": {
      "sender": {
        "id": 801,
        "name": "Dana Cohen",
        "type": "contact"
      },
      "assignee": null,
      "team": null,
      "hmac_verified": false
    },
    "unread_count": 1,
    "snoozed_until": null,
    "waiting_since": 1794470700,
    "last_activity_at": 1794470700,
    "agent_last_seen_at": 0,
    "contact_last_seen_at": 0,
    "assignee_last_seen_at": 0,
    "timestamp": 1794470700,
    "created_at": 1794470400
  },
  "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.
