# WebhookPayload

Type: object

Signed webhook event body. Deduplicate deliveries by id, which matches the webhook-id header.

## Properties

## Discriminator

Use `type` with one of `contact.created`, `contact.updated`, `contact.archived`, `conversation.started`, `conversation.updated`, `conversation.closed`, `message.created`, `message.updated`.

## Variants

### ContactCreatedWebhookEvent

Discriminator value: `contact.created`

Required fields: `id`, `type`, `timestamp`, `data`

- `id` (string, required) - Event id. Matches the `webhook-id` header and is the consumer dedupe key.
- `type` (enum, required)
- `timestamp` (string, required) - Time when the source domain event happened.
- `data` (ContactWebhookEventData, required)

```json
{
  "id": "string",
  "type": "contact.created",
  "timestamp": "string",
  "data": {
    "contact": {
      "id": "con_01HV8Y5R5RFMS0TFK6PKF9H2S8",
      "tenantId": "tn_01HV8Y1N3QPY9X2HBQ1M9E8D0",
      "name": "Anna Kowalska",
      "createdAt": "2026-04-30T09:20:00Z",
      "updatedAt": "2026-04-30T10:10:00Z",
      "identities": [
        {
          "id": "idn_01HV8Y7YF5J4Y7M9M7T3H3X2A1",
          "channel": "whatsapp",
          "metadata": {
            "phoneNumber": "+48123456789"
          }
        }
      ],
      "tagIds": [
        "tag_01HV8Y9R3Q4J6A7M8N9P0Q2S4"
      ],
      "customFields": {
        "lifecycleStage": "customer",
        "preferredStore": "Krakow"
      },
      "archivedAt": null
    }
  }
}
```

### ContactUpdatedWebhookEvent

Discriminator value: `contact.updated`

Required fields: `id`, `type`, `timestamp`, `data`

- `id` (string, required) - Event id. Matches the `webhook-id` header and is the consumer dedupe key.
- `type` (enum, required)
- `timestamp` (string, required) - Time when the source domain event happened.
- `data` (ContactWebhookEventData, required)

```json
{
  "id": "string",
  "type": "contact.updated",
  "timestamp": "string",
  "data": {
    "contact": {
      "id": "con_01HV8Y5R5RFMS0TFK6PKF9H2S8",
      "tenantId": "tn_01HV8Y1N3QPY9X2HBQ1M9E8D0",
      "name": "Anna Kowalska",
      "createdAt": "2026-04-30T09:20:00Z",
      "updatedAt": "2026-04-30T10:10:00Z",
      "identities": [
        {
          "id": "idn_01HV8Y7YF5J4Y7M9M7T3H3X2A1",
          "channel": "whatsapp",
          "metadata": {
            "phoneNumber": "+48123456789"
          }
        }
      ],
      "tagIds": [
        "tag_01HV8Y9R3Q4J6A7M8N9P0Q2S4"
      ],
      "customFields": {
        "lifecycleStage": "customer",
        "preferredStore": "Krakow"
      },
      "archivedAt": null
    }
  }
}
```

### ContactArchivedWebhookEvent

Discriminator value: `contact.archived`

Required fields: `id`, `type`, `timestamp`, `data`

- `id` (string, required) - Event id. Matches the `webhook-id` header and is the consumer dedupe key.
- `type` (enum, required)
- `timestamp` (string, required) - Time when the source domain event happened.
- `data` (ContactWebhookEventData, required)

```json
{
  "id": "string",
  "type": "contact.archived",
  "timestamp": "string",
  "data": {
    "contact": {
      "id": "con_01HV8Y5R5RFMS0TFK6PKF9H2S8",
      "tenantId": "tn_01HV8Y1N3QPY9X2HBQ1M9E8D0",
      "name": "Anna Kowalska",
      "createdAt": "2026-04-30T09:20:00Z",
      "updatedAt": "2026-04-30T10:10:00Z",
      "identities": [
        {
          "id": "idn_01HV8Y7YF5J4Y7M9M7T3H3X2A1",
          "channel": "whatsapp",
          "metadata": {
            "phoneNumber": "+48123456789"
          }
        }
      ],
      "tagIds": [
        "tag_01HV8Y9R3Q4J6A7M8N9P0Q2S4"
      ],
      "customFields": {
        "lifecycleStage": "customer",
        "preferredStore": "Krakow"
      },
      "archivedAt": null
    }
  }
}
```

### ConversationStartedWebhookEvent

Discriminator value: `conversation.started`

Required fields: `id`, `type`, `timestamp`, `data`

- `id` (string, required) - Event id. Matches the `webhook-id` header and is the consumer dedupe key.
- `type` (enum, required)
- `timestamp` (string, required) - Time when the source domain event happened.
- `data` (ConversationWebhookEventData, required)

```json
{
  "id": "string",
  "type": "conversation.started",
  "timestamp": "string",
  "data": {
    "conversation": {
      "id": "cnv_01HV8Y7YF5J4Y7M9M7T3H3X2A1",
      "channel": "whatsapp",
      "externalId": "48123456789",
      "inboxId": "ibx_01HV8Y4QH7C8H1K5K0C8A2B9E4",
      "name": "Anna Kowalska",
      "contactId": "con_01HV8Y5R5RFMS0TFK6PKF9H2S8",
      "contactName": "Anna Kowalska",
      "lastMessageAt": "2026-04-30T10:35:00Z",
      "lastMessagePreview": "Thanks, I will check it now.",
      "lastMessageSender": "customer"
    },
    "contact": {
      "id": "con_01HV8Y5R5RFMS0TFK6PKF9H2S8",
      "tenantId": "tn_01HV8Y1N3QPY9X2HBQ1M9E8D0",
      "name": "Anna Kowalska",
      "createdAt": "2026-04-30T09:20:00Z",
      "updatedAt": "2026-04-30T10:10:00Z",
      "identities": [
        {
          "id": "idn_01HV8Y7YF5J4Y7M9M7T3H3X2A1",
          "channel": "whatsapp",
          "metadata": {
            "phoneNumber": "+48123456789"
          }
        }
      ],
      "tagIds": [
        "tag_01HV8Y9R3Q4J6A7M8N9P0Q2S4"
      ],
      "customFields": {
        "lifecycleStage": "customer",
        "preferredStore": "Krakow"
      },
      "archivedAt": null
    },
    "inbox": {
      "id": "ibx_01HV8Y4QH7C8H1K5K0C8A2B9E4",
      "createdAt": "2026-04-30T09:00:00Z",
      "updatedAt": "2026-04-30T09:10:00Z",
      "tenantId": "tn_01HV8Y1N3QPY9X2HBQ1M9E8D0",
      "channel": "whatsapp",
      "externalId": "112233445566778",
      "createdBy": "usr_01HV8Y3K2R6G7K3F5B9N8M1Q0",
      "name": "Support WhatsApp",
      "teamId": "team_01HV8Y6W0W4T5A8S9V7Q2P1M3",
      "status": {
        "state": "active",
        "reasons": []
      },
      "config": {
        "phoneNumberId": "112233445566778"
      }
    }
  }
}
```

### ConversationUpdatedWebhookEvent

Discriminator value: `conversation.updated`

Required fields: `id`, `type`, `timestamp`, `data`

- `id` (string, required) - Event id. Matches the `webhook-id` header and is the consumer dedupe key.
- `type` (enum, required)
- `timestamp` (string, required) - Time when the source domain event happened.
- `data` (ConversationWebhookEventData, required)

```json
{
  "id": "string",
  "type": "conversation.updated",
  "timestamp": "string",
  "data": {
    "conversation": {
      "id": "cnv_01HV8Y7YF5J4Y7M9M7T3H3X2A1",
      "channel": "whatsapp",
      "externalId": "48123456789",
      "inboxId": "ibx_01HV8Y4QH7C8H1K5K0C8A2B9E4",
      "name": "Anna Kowalska",
      "contactId": "con_01HV8Y5R5RFMS0TFK6PKF9H2S8",
      "contactName": "Anna Kowalska",
      "lastMessageAt": "2026-04-30T10:35:00Z",
      "lastMessagePreview": "Thanks, I will check it now.",
      "lastMessageSender": "customer"
    },
    "contact": {
      "id": "con_01HV8Y5R5RFMS0TFK6PKF9H2S8",
      "tenantId": "tn_01HV8Y1N3QPY9X2HBQ1M9E8D0",
      "name": "Anna Kowalska",
      "createdAt": "2026-04-30T09:20:00Z",
      "updatedAt": "2026-04-30T10:10:00Z",
      "identities": [
        {
          "id": "idn_01HV8Y7YF5J4Y7M9M7T3H3X2A1",
          "channel": "whatsapp",
          "metadata": {
            "phoneNumber": "+48123456789"
          }
        }
      ],
      "tagIds": [
        "tag_01HV8Y9R3Q4J6A7M8N9P0Q2S4"
      ],
      "customFields": {
        "lifecycleStage": "customer",
        "preferredStore": "Krakow"
      },
      "archivedAt": null
    },
    "inbox": {
      "id": "ibx_01HV8Y4QH7C8H1K5K0C8A2B9E4",
      "createdAt": "2026-04-30T09:00:00Z",
      "updatedAt": "2026-04-30T09:10:00Z",
      "tenantId": "tn_01HV8Y1N3QPY9X2HBQ1M9E8D0",
      "channel": "whatsapp",
      "externalId": "112233445566778",
      "createdBy": "usr_01HV8Y3K2R6G7K3F5B9N8M1Q0",
      "name": "Support WhatsApp",
      "teamId": "team_01HV8Y6W0W4T5A8S9V7Q2P1M3",
      "status": {
        "state": "active",
        "reasons": []
      },
      "config": {
        "phoneNumberId": "112233445566778"
      }
    }
  }
}
```

### ConversationClosedWebhookEvent

Discriminator value: `conversation.closed`

Required fields: `id`, `type`, `timestamp`, `data`

- `id` (string, required) - Event id. Matches the `webhook-id` header and is the consumer dedupe key.
- `type` (enum, required)
- `timestamp` (string, required) - Time when the source domain event happened.
- `data` (ConversationWebhookEventData, required)

```json
{
  "id": "string",
  "type": "conversation.closed",
  "timestamp": "string",
  "data": {
    "conversation": {
      "id": "cnv_01HV8Y7YF5J4Y7M9M7T3H3X2A1",
      "channel": "whatsapp",
      "externalId": "48123456789",
      "inboxId": "ibx_01HV8Y4QH7C8H1K5K0C8A2B9E4",
      "name": "Anna Kowalska",
      "contactId": "con_01HV8Y5R5RFMS0TFK6PKF9H2S8",
      "contactName": "Anna Kowalska",
      "lastMessageAt": "2026-04-30T10:35:00Z",
      "lastMessagePreview": "Thanks, I will check it now.",
      "lastMessageSender": "customer"
    },
    "contact": {
      "id": "con_01HV8Y5R5RFMS0TFK6PKF9H2S8",
      "tenantId": "tn_01HV8Y1N3QPY9X2HBQ1M9E8D0",
      "name": "Anna Kowalska",
      "createdAt": "2026-04-30T09:20:00Z",
      "updatedAt": "2026-04-30T10:10:00Z",
      "identities": [
        {
          "id": "idn_01HV8Y7YF5J4Y7M9M7T3H3X2A1",
          "channel": "whatsapp",
          "metadata": {
            "phoneNumber": "+48123456789"
          }
        }
      ],
      "tagIds": [
        "tag_01HV8Y9R3Q4J6A7M8N9P0Q2S4"
      ],
      "customFields": {
        "lifecycleStage": "customer",
        "preferredStore": "Krakow"
      },
      "archivedAt": null
    },
    "inbox": {
      "id": "ibx_01HV8Y4QH7C8H1K5K0C8A2B9E4",
      "createdAt": "2026-04-30T09:00:00Z",
      "updatedAt": "2026-04-30T09:10:00Z",
      "tenantId": "tn_01HV8Y1N3QPY9X2HBQ1M9E8D0",
      "channel": "whatsapp",
      "externalId": "112233445566778",
      "createdBy": "usr_01HV8Y3K2R6G7K3F5B9N8M1Q0",
      "name": "Support WhatsApp",
      "teamId": "team_01HV8Y6W0W4T5A8S9V7Q2P1M3",
      "status": {
        "state": "active",
        "reasons": []
      },
      "config": {
        "phoneNumberId": "112233445566778"
      }
    }
  }
}
```

### MessageCreatedWebhookEvent

Discriminator value: `message.created`

Required fields: `id`, `type`, `timestamp`, `data`

- `id` (string, required) - Event id. Matches the `webhook-id` header and is the consumer dedupe key.
- `type` (enum, required)
- `timestamp` (string, required) - Time when the source domain event happened.
- `data` (MessageWebhookEventData, required)

```json
{
  "id": "string",
  "type": "message.created",
  "timestamp": "string",
  "data": {
    "message": {
      "id": "msg_01HV8Z2G8Z3H5M9K2S6A1N0P4",
      "createdAt": "2026-04-30T10:36:00Z",
      "updatedAt": "2026-04-30T10:36:02Z",
      "tenantId": "tn_01HV8Y1N3QPY9X2HBQ1M9E8D0",
      "conversationId": "cnv_01HV8Y7YF5J4Y7M9M7T3H3X2A1",
      "senderType": "user",
      "senderId": "usr_01HV8Y3K2R6G7K3F5B9N8M1Q0",
      "content": {
        "type": "text",
        "text": {
          "body": "Hi Anna, your order is ready for pickup."
        }
      },
      "deliveryStatus": "delivered",
      "channelMessageId": "wamid.HBgLMjQxMjM0NTY3ODkVAgARGBI"
    },
    "conversation": {
      "id": "cnv_01HV8Y7YF5J4Y7M9M7T3H3X2A1",
      "channel": "whatsapp",
      "externalId": "48123456789",
      "inboxId": "ibx_01HV8Y4QH7C8H1K5K0C8A2B9E4",
      "name": "Anna Kowalska",
      "contactId": "con_01HV8Y5R5RFMS0TFK6PKF9H2S8",
      "contactName": "Anna Kowalska",
      "lastMessageAt": "2026-04-30T10:35:00Z",
      "lastMessagePreview": "Thanks, I will check it now.",
      "lastMessageSender": "customer"
    },
    "contact": {
      "id": "con_01HV8Y5R5RFMS0TFK6PKF9H2S8",
      "tenantId": "tn_01HV8Y1N3QPY9X2HBQ1M9E8D0",
      "name": "Anna Kowalska",
      "createdAt": "2026-04-30T09:20:00Z",
      "updatedAt": "2026-04-30T10:10:00Z",
      "identities": [
        {
          "id": "idn_01HV8Y7YF5J4Y7M9M7T3H3X2A1",
          "channel": "whatsapp",
          "metadata": {
            "phoneNumber": "+48123456789"
          }
        }
      ],
      "tagIds": [
        "tag_01HV8Y9R3Q4J6A7M8N9P0Q2S4"
      ],
      "customFields": {
        "lifecycleStage": "customer",
        "preferredStore": "Krakow"
      },
      "archivedAt": null
    },
    "inbox": {
      "id": "ibx_01HV8Y4QH7C8H1K5K0C8A2B9E4",
      "createdAt": "2026-04-30T09:00:00Z",
      "updatedAt": "2026-04-30T09:10:00Z",
      "tenantId": "tn_01HV8Y1N3QPY9X2HBQ1M9E8D0",
      "channel": "whatsapp",
      "externalId": "112233445566778",
      "createdBy": "usr_01HV8Y3K2R6G7K3F5B9N8M1Q0",
      "name": "Support WhatsApp",
      "teamId": "team_01HV8Y6W0W4T5A8S9V7Q2P1M3",
      "status": {
        "state": "active",
        "reasons": []
      },
      "config": {
        "phoneNumberId": "112233445566778"
      }
    }
  }
}
```

### MessageUpdatedWebhookEvent

Discriminator value: `message.updated`

Required fields: `id`, `type`, `timestamp`, `data`

- `id` (string, required) - Event id. Matches the `webhook-id` header and is the consumer dedupe key.
- `type` (enum, required)
- `timestamp` (string, required) - Time when the source domain event happened.
- `data` (MessageWebhookEventData, required)

```json
{
  "id": "string",
  "type": "message.updated",
  "timestamp": "string",
  "data": {
    "message": {
      "id": "msg_01HV8Z2G8Z3H5M9K2S6A1N0P4",
      "createdAt": "2026-04-30T10:36:00Z",
      "updatedAt": "2026-04-30T10:36:02Z",
      "tenantId": "tn_01HV8Y1N3QPY9X2HBQ1M9E8D0",
      "conversationId": "cnv_01HV8Y7YF5J4Y7M9M7T3H3X2A1",
      "senderType": "user",
      "senderId": "usr_01HV8Y3K2R6G7K3F5B9N8M1Q0",
      "content": {
        "type": "text",
        "text": {
          "body": "Hi Anna, your order is ready for pickup."
        }
      },
      "deliveryStatus": "delivered",
      "channelMessageId": "wamid.HBgLMjQxMjM0NTY3ODkVAgARGBI"
    },
    "conversation": {
      "id": "cnv_01HV8Y7YF5J4Y7M9M7T3H3X2A1",
      "channel": "whatsapp",
      "externalId": "48123456789",
      "inboxId": "ibx_01HV8Y4QH7C8H1K5K0C8A2B9E4",
      "name": "Anna Kowalska",
      "contactId": "con_01HV8Y5R5RFMS0TFK6PKF9H2S8",
      "contactName": "Anna Kowalska",
      "lastMessageAt": "2026-04-30T10:35:00Z",
      "lastMessagePreview": "Thanks, I will check it now.",
      "lastMessageSender": "customer"
    },
    "contact": {
      "id": "con_01HV8Y5R5RFMS0TFK6PKF9H2S8",
      "tenantId": "tn_01HV8Y1N3QPY9X2HBQ1M9E8D0",
      "name": "Anna Kowalska",
      "createdAt": "2026-04-30T09:20:00Z",
      "updatedAt": "2026-04-30T10:10:00Z",
      "identities": [
        {
          "id": "idn_01HV8Y7YF5J4Y7M9M7T3H3X2A1",
          "channel": "whatsapp",
          "metadata": {
            "phoneNumber": "+48123456789"
          }
        }
      ],
      "tagIds": [
        "tag_01HV8Y9R3Q4J6A7M8N9P0Q2S4"
      ],
      "customFields": {
        "lifecycleStage": "customer",
        "preferredStore": "Krakow"
      },
      "archivedAt": null
    },
    "inbox": {
      "id": "ibx_01HV8Y4QH7C8H1K5K0C8A2B9E4",
      "createdAt": "2026-04-30T09:00:00Z",
      "updatedAt": "2026-04-30T09:10:00Z",
      "tenantId": "tn_01HV8Y1N3QPY9X2HBQ1M9E8D0",
      "channel": "whatsapp",
      "externalId": "112233445566778",
      "createdBy": "usr_01HV8Y3K2R6G7K3F5B9N8M1Q0",
      "name": "Support WhatsApp",
      "teamId": "team_01HV8Y6W0W4T5A8S9V7Q2P1M3",
      "status": {
        "state": "active",
        "reasons": []
      },
      "config": {
        "phoneNumberId": "112233445566778"
      }
    }
  }
}
```

