> ## Documentation Index
> Fetch the complete documentation index at: https://docs.d-api.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Chats, contacts and presence

> Chat, contact and presence (online/typing) updates.

These events keep your system in sync with the **state of chats**,
**contact data** and **presence** (online, last seen). All of them follow
the [common envelope](https://docs.d-api.cloud/en/whatsapp/webhooks/visao-geral.md) — the specific content is
in `data`.

## `chats.update` and `chats.upsert`

`chats.upsert` indicates a chat **created or received during sync**;
`chats.update` indicates an **update** to an existing chat. Both events
have the **same** `data` **format**.

```json theme={null}
{
  "event": "chats.update",
  "sessionId": "my-session",
  "timestamp": "2026-01-24T23:05:00.000Z",
  "data": {
    "jid": "5511999999999@s.whatsapp.net",
    "name": "João",
    "unread_count": 2,
    "conversation_timestamp": 1769295900,
    "archived": false,
    "pinned": 0,
    "mute_end_time": 0
  }
}
```

**jid** `string` *required*

JID of the chat (contact or group).

**name** `string`

Chat name (contact or group name).

**unread\_count** `number`

Number of unread messages.

**conversation\_timestamp** `number`

Time of the conversation's last activity in seconds (epoch).

**archived** `boolean`

`true` when the chat is archived.

**pinned** `number`

Indicates whether the chat is pinned (`0` when it is not).

**mute\_end\_time** `number`

Time (epoch) when the mute ends; `0` when the chat is not
muted.

> [!NOTE]
>
> `chats.upsert` events go through a **2-second debounce** per chat:
> multiple consecutive updates to the same chat are grouped together.

## `contacts.update` and `contacts.upsert`

`contacts.upsert` indicates a contact **created or received during sync**;
`contacts.update` indicates an **update** to an existing contact. Both
events have the **same** `data` **format**.

```json theme={null}
{
  "event": "contacts.update",
  "sessionId": "my-session",
  "timestamp": "2026-01-24T23:06:00.000Z",
  "data": {
    "jid": "5511999999999@s.whatsapp.net",
    "push_name": "João",
    "full_name": "João Silva",
    "first_name": "João",
    "business_name": ""
  }
}
```

**jid** `string` *required*

JID of the contact.

**push\_name** `string`

Display name set by the contact themselves on WhatsApp.

**full\_name** `string`

Full name of the contact (when saved in the address book).

**first\_name** `string`

First name of the contact.

**business\_name** `string`

Business name, when the contact is a business account. Empty string (`""`)
when not applicable.

> [!NOTE]
>
> `contacts.upsert` events go through a **2-second debounce** per contact:
> multiple consecutive updates to the same contact are grouped together.

## `presence`

Fired when a contact's **presence** changes (online/offline, last
seen).

```json theme={null}
{
  "event": "presence",
  "sessionId": "my-session",
  "timestamp": "2026-01-24T23:07:00.000Z",
  "data": {
    "jid": "5511999999999@s.whatsapp.net",
    "name": "João",
    "unavailable": false,
    "last_seen": 1769296020
  }
}
```

**jid** `string` *required*

JID of the contact whose presence changed.

**name** `string`

Contact name.

**unavailable** `boolean`

`true` when the contact is **offline/unavailable**; `false` when they are
online.

**last\_seen** `number`

Time of last access in seconds (epoch), when available.

> [!NOTE]
>
> The `presence` event goes through a **5-second deduplication** per contact and
> state (online/offline): identical changes within that window do not produce
> duplicate webhooks.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.