Skip to main content
Plunk can send HTTP requests to your server whenever specific events occur — email bounces, spam complaints, contact subscription changes, and more. Webhooks are powered by Plunk’s workflow system, which means you can combine them with conditions, delays, and other steps to build sophisticated integrations.

How it works

Webhooks in Plunk are not a standalone feature. They are a step type in the workflow builder. The flow is:
  1. An event occurs in Plunk (an email bounces, a contact subscribes, a custom event fires)
  2. A workflow is triggered by that event
  3. The workflow executes a Webhook step, sending a POST request to your endpoint with the event data
This design means you can apply filters, delays, and transformations before any data leaves Plunk.

Internal events

Plunk automatically generates a set of internal events. You cannot track these manually via the API — they are emitted by the system.

Email events

EventDescription
email.sentAn email was successfully sent
email.deliveryAn email was delivered to the recipient
email.openA contact opened an email (first open only)
email.clickA contact clicked a link in an email (first click only)
email.bounceAn email bounced — permanent or transient
email.complaintA contact marked an email as spam
email.receivedAn email was received at your verified domain (requires inbound email setup)

Contact events

EventDescription
contact.subscribedA contact’s subscription status changed to subscribed
contact.unsubscribedA contact’s subscription status changed to unsubscribed

Segment events

EventDescription
segment.<name>.entryA contact entered a segment
segment.<name>.exitA contact exited a segment
Segment event names use a slugified version of the segment name. A segment called “VIP Users” produces the events segment.vip-users.entry and segment.vip-users.exit.

Setting up a webhook

1

Create the workflow

Go to Workflows in the dashboard and create a new workflow. Select the trigger event — for example, email.bounce to receive notifications when an email bounces.
2

Add a Webhook step

After the trigger, click Add step and choose Webhook. Configure the step:
  • URL: The endpoint on your server that will receive the request (e.g. https://api.example.com/webhooks/plunk)
  • Method: POST is recommended and is the default
  • Headers (optional): Custom request headers as JSON. Use this to pass an authentication token to your endpoint:
{
  "Authorization": "Bearer your-secret-token",
  "X-Webhook-Source": "plunk"
}
3

Enable the workflow

Save and enable the workflow. It will immediately start sending requests whenever the trigger event fires.

Webhook payload

Plunk sends a JSON POST body with four top-level fields:
{
  "contact": {
    "email": "[email protected]",
    "subscribed": true,
    "data": {
      "name": "Jane",
      "plan": "pro"
    }
  },
  "workflow": {
    "id": "wf_abc123",
    "name": "Bounce notifications"
  },
  "execution": {
    "id": "exec_xyz789",
    "startedAt": "2025-01-15T10:30:00.000Z"
  },
  "event": {}
}
FieldDescription
contactThe contact associated with the event — email, subscription status, and custom data fields
workflowThe workflow that triggered this webhook
executionThe specific workflow execution instance
eventEvent-specific data (contents vary by event type — see below)

Event data by type

The event field contains data specific to the event that triggered the workflow.

Email events

All email events share a common set of base fields:
FieldDescription
subjectThe email subject line
fromThe sender email address
fromNameThe sender display name
messageIdThe AWS SES message ID
templateIdThe template ID, or null if no template was used
campaignIdThe campaign ID, or null if not part of a campaign
sourceTypeHow the email was sent: TRANSACTIONAL, CAMPAIGN, WORKFLOW, or INBOUND
Each event type adds its own fields on top of these:
{
  "subject": "Welcome to Plunk",
  "from": "[email protected]",
  "fromName": "Plunk Team",
  "messageId": "ses-message-id",
  "templateId": null,
  "campaignId": null,
  "sourceType": "TRANSACTIONAL",
  "sentAt": "2025-01-15T10:30:00.000Z"
}
FieldDescription
sentAtWhen the email was sent

Contact events

contact.subscribed and contact.unsubscribed carry no event data by default. The event field is an empty object {}. When an unsubscription is triggered automatically by a bounce or complaint, event includes a reason field:
{
  "reason": "bounce"
}
FieldValue
reason"bounce" or "complaint" when the system triggered the unsubscription

Segment events

Both segment.<name>.entry and segment.<name>.exit include:
{
  "segmentId": "seg_abc123",
  "segmentName": "VIP Users"
}
FieldDescription
segmentIdThe ID of the segment
segmentNameThe display name of the segment

Custom events

Custom events tracked via the API include whatever data you passed in the data field of the /v1/track call.

Common use cases

Bounce and complaint monitoring

Create workflows triggered by email.bounce and email.complaint to keep your own database in sync with Plunk’s contact statuses. Because only Permanent bounces count toward your bounce rate, you can use a Condition step to filter for bounceType === "Permanent" before forwarding to your webhook endpoint.

Syncing unsubscribes

Trigger a workflow on contact.unsubscribed to notify your application whenever a contact opts out. This is useful when you manage subscription preferences across multiple systems and need to keep them consistent.

Custom event forwarding

If you track custom events in Plunk (e.g. user.signup, order.completed), you can forward those events to other services using webhooks. Track once in Plunk, distribute to as many endpoints as you need.

Adding conditions and delays

Because webhooks are workflow steps, you can combine them with other step types:
  • Condition step: Only fire the webhook when specific criteria are met — for example, only for contacts with plan = "pro", or only for Permanent bounces.
  • Delay step: Add a time buffer before the webhook fires.
  • Wait for Event step: Pause the workflow until a follow-up event occurs — for example, wait to see if a bounced contact re-subscribes before notifying your system.

Build docs developers (and LLMs) love