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

# Webhooks

> Real-time notifications for events that happen in your Pocketflows project

Pocketflows can deliver webhooks to your server whenever certain events occur in
your project. This allows you to react to changes — such as a campaign being
updated — without polling the API.

## Payload shape

Every webhook delivery has the same top-level shape:

<ResponseField name="id" type="string">
  The ID of the event (prefixed `pe_`).
</ResponseField>

<ResponseField name="type" type="string">
  The event type. See the full list below.
</ResponseField>

<ResponseField name="data" type="object">
  The event payload. The shape depends on `type`.
</ResponseField>

Example:

```json theme={null}
{
  "id": "pe_abc123",
  "type": "campaign.updated",
  "data": { "...": "..." }
}
```

## Event types

### Campaign

#### `campaign.created`

Fires when a new campaign is created. `data` is the
[Campaign](/email_and_sms/campaigns/schema) object.

#### `campaign.updated`

Fires when an existing campaign is updated. `data` is the
[Campaign](/email_and_sms/campaigns/schema) object.

#### `campaign.deleted`

Fires when a campaign is deleted. `data` is the
[Campaign](/email_and_sms/campaigns/schema) object as it existed at the time of
deletion.

### Trigger

#### `trigger.created`

Fires when a new trigger is created. `data` is the
[Trigger](/email_and_sms/triggers/schema) object.

#### `trigger.updated`

Fires when an existing trigger is updated. `data` is the
[Trigger](/email_and_sms/triggers/schema) object.

#### `trigger.deleted`

Fires when a trigger is deleted. `data` is the
[Trigger](/email_and_sms/triggers/schema) object as it existed at the time of
deletion.

### Segment

#### `segment.created`

Fires when a new segment is created. `data` is the
[Segment](/base/segments/schema) object.

#### `segment.updated`

Fires when an existing segment is updated. `data` is the
[Segment](/base/segments/schema) object.

#### `segment.deleted`

Fires when a segment is deleted. `data` is the [Segment](/base/segments/schema)
object as it existed at the time of deletion.
