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

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

# Contact Events

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

Online sends a contact event to your webhook when a contact is created, changed or deleted.

| Subscription | Sent when |
| --- | --- |
| `contact_created` | A contact was created. |
| `contact_updated` | A contact changed. Includes `changed_attributes`. |
| `contact_deleted` | A contact was deleted. |

The payload is the contact. Contact events are account-wide: they are 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** — `contact_updated`:

```json
{
  "event": "contact_updated",
  "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"
  },
  "changed_attributes": [
    {
      "name": {
        "previous_value": "Dana",
        "current_value": "Dana Cohen"
      }
    }
  ],
  "allow_unverified_ssl": false
}
```

### Payload explained

| Parameter | Description / Example |
| --- | --- |
| `event` | What happened. See the values below. |
| `type` | Always `contact`. |
| `id` | The contact ID. |
| `name` | The name. |
| `email` | The email. |
| `phone_number` | The phone number in E.164 format. |
| `identifier` | Your own external ID for the contact. |
| `additional_attributes` | Standard extra fields, such as `company_name` and `city`. |
| `custom_attributes` | The contact's custom attributes. |
| `avatar` | The avatar URL, or an empty string. |
| `thumbnail` | The avatar thumbnail URL, or an empty string. |
| `account` | The account. |
| `changed_attributes` | `contact_updated` only. What changed: one object per attribute, keyed by its name, with its `previous_value` and `current_value`. |
| `allow_unverified_ssl` | Added by Online to every payload. |

#### `event`

| Value | Explanation |
| --- | --- |
| contact_created | A contact was created. |
| contact_updated | A contact changed. |
| contact_deleted | A contact was deleted. |

## Webhook payload

Content type: `application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `event` | string | Yes | What happened. One of: `contact_created` — A contact was created; `contact_updated` — A contact changed; `contact_deleted` — A contact was deleted. |
| `type` | string | No | Always `contact`. |
| `id` | integer | No | The contact ID. |
| `name` | string | No | The name. |
| `email` | string \| null | No | The email. |
| `phone_number` | string \| null | No | The phone number in E.164 format. |
| `identifier` | string \| null | No | Your own external ID for the contact. |
| `additional_attributes` | object | No | Standard extra fields, such as `company_name` and `city`. |
| `custom_attributes` | object | No | The contact's custom attributes. |
| `avatar` | string | No | The avatar URL, or an empty string. |
| `thumbnail` | string | No | The avatar thumbnail URL, or an empty string. |
| `account` | object | No | The account. |
| `account.id` | integer | No | The account ID. |
| `account.name` | string | No | The account name. |
| `changed_attributes` | array of object | No | `contact_updated` only. What changed: one object per attribute, keyed by its name, with its `previous_value` and `current_value`. |
| `allow_unverified_ssl` | boolean | Yes | Added by Online to every payload. |

### Example (generated from the schema)

```json
{
  "event": "contact_updated",
  "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"
  },
  "changed_attributes": [
    {
      "name": {
        "previous_value": "Dana",
        "current_value": "Dana Cohen"
      }
    }
  ],
  "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.
