# contact.updated

HTML: https://www.app2email.com/docs/api/webhooks/contact.updated · Index: https://www.app2email.com/docs/api/llms.txt

A contact was made or changed through the API (upsert, patch, consent; not imports), or turned marketing messages back on in WhatsApp.

Group: Contacts. Header `X-App2email-Event: contact.updated`. Inside the envelope `{id, type, created, number, test?, data}` ([envelope, headers, signature](https://www.app2email.com/docs/api/webhooks.md)). Every webhook of the number gets every number event: filter by `type`.

## data

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `data.contact` | object | yes |  |
| `data.contact.identity` | string |  |  |
| `data.contact.identity_type` | string |  | one of: `phone`, `bsuid` |
| `data.contact.phone` | string |  |  |
| `data.contact.name` | string |  |  |
| `data.contact.tags` | string[] |  |  |
| `data.contact.custom_fields` | object |  | any keys |
| `data.contact.source` | string |  |  |
| `data.contact.consent` | object |  |  |
| `data.contact.consent.marketing` | boolean |  |  |
| `data.contact.consent.at` | string |  |  |
| `data.contact.consent.source` | string |  |  |
| `data.contact.consent.text` | string |  |  |
| `data.contact.consent.evidence` | string |  |  |
| `data.contact.consent.recorded` | boolean |  | true when any consent record exists. |
| `data.contact.last_inbound_at` | string |  |  |
| `data.contact.last_outbound_at` | string |  |  |
| `data.contact.created` | string |  |  |
| `data.contact.updated` | string |  |  |
| `data.change` | string | yes | one of: `upsert`, `patch`, `consent`, `marketing_resumed` |
| `data.timestamp` | string |  |  |
| `data.detail` | string |  |  |

## Samples

### upsert

```json
{
  "id": "evt_Xq3k9m2Lw8Rt5Yp1Zs01",
  "type": "contact.updated",
  "created": "2026-11-06T01:00:00.000Z",
  "number": "4976659348270",
  "data": {
    "contact": {
      "identity": "61412345678",
      "identity_type": "phone",
      "phone": "61412345678",
      "name": "Sample Contact",
      "tags": [
        "vip"
      ],
      "custom_fields": {
        "city": "Sydney"
      },
      "source": "api",
      "consent": {
        "marketing": true,
        "at": "2026-11-06T01:00:00.000Z",
        "source": "website form",
        "recorded": true
      },
      "created": "2026-11-06T01:00:00.000Z",
      "updated": "2026-11-06T01:00:00.000Z"
    },
    "change": "upsert",
    "timestamp": "2026-11-06T01:00:00.000Z"
  }
}
```

### marketing resumed

```json
{
  "id": "evt_Pa3k9m2Lw8Rt5Yp1Zs016",
  "type": "contact.updated",
  "created": "2026-11-06T01:00:00.000Z",
  "number": "4976659348270",
  "data": {
    "contact": {
      "identity": "61412345678",
      "identity_type": "phone",
      "phone": "61412345678"
    },
    "change": "marketing_resumed",
    "detail": "User resumed marketing messages",
    "timestamp": "2026-11-06T01:00:00.000Z"
  }
}
```

## Caused by

- [Make or update contacts (one, or a list of up to 1000)](https://www.app2email.com/docs/api/contacts/upsert-contacts.md): `POST /v1/{number}/contacts`
- [Change a contact](https://www.app2email.com/docs/api/contacts/update-contact.md): `PATCH /v1/{number}/contacts/{identity}`
- [Record consent (or its withdrawal) with evidence](https://www.app2email.com/docs/api/contacts/record-consent.md): `POST /v1/{number}/contacts/{identity}/consent`

Send it to your URL: https://www.app2email.com/docs/api/webhooks/tester?type=contact.updated
