---
title: Zapier
description: Send email from a Zap and start Zaps from BillionSend events, with Webhooks by Zapier and no code.
seo:
  title: Send and catch email events in Zapier
---

Zapier reaches BillionSend through **Webhooks by Zapier**, in both directions: a **Custom Request** action sends an email through the REST API, and a **Catch Hook** trigger starts a Zap when BillionSend reports an [event](/docs/concepts/webhooks) such as a bounce, a delivery or a received message.

## Send an email from a Zap

Use a regular `bs_` API key. Create one under [API keys](/docs/api-keys) in the dashboard; an agent key is for the [MCP server](/docs/mcp).

1. **Add an action** to the Zap: choose **Webhooks by Zapier**, then the event **Custom Request**. Zapier's POST event also works for simple bodies; Custom Request lets you type the whole JSON body, including arrays such as `to`.
2. **Fill in the step:**
   - **Method:** `POST`
   - **URL:** `https://api.billionsend.com/emails`
   - **Data:** the JSON body, typed raw (Zapier sends it exactly as entered, so check that the syntax is valid):

     ```json
     {
       "from": "Example <notifications@example.com>",
       "to": ["customer@example.org"],
       "subject": "Your order has shipped",
       "html": "<p>Your order is on its way.</p>"
     }
     ```

     Insert fields from earlier steps where the values go, such as the customer's address in `to`.
   - **Headers:** add `Authorization` with the value `Bearer bs_...` and `Content-Type` with the value `application/json`.
3. **Test the step.** The response carries the email's `id`.

The `from` address must be on a [verified domain](/docs/concepts/domains). The request is [`POST /emails`](/docs/api-reference), so [templates](/docs/concepts/templates), `scheduled_at` and `tags` work here too. Add an `Idempotency-Key` header (1 to 256 characters) built from a field that stays the same when the Zap replays, such as the order id, so a replay does not send the email twice (see [API basics](/docs/api-reference/basics)).

Anyone who can edit the Zap can read the key in the **Headers** section. Create a key for the Zap alone, and revoke it when the Zap is deleted.

## Start a Zap from an event

1. **Add a trigger**: choose **Webhooks by Zapier**, then **Catch Hook**. In the **Test** tab, copy the webhook URL.
2. **Create the endpoint in BillionSend** with that URL and the events you want:

   ```sh
   curl -X POST "https://api.billionsend.com/webhooks" \
     -H "Authorization: Bearer bs_..." \
     -H "Content-Type: application/json" \
     -d '{
       "endpoint": "https://hooks.zapier.com/hooks/catch/123456/abcdef/",
       "events": ["email.bounced", "email.complained"]
     }'
   ```

   Or add it under **Webhooks** in the dashboard.
3. **Trigger a test event** (any event the endpoint listens for, such as sending an email), then click **Test trigger** in Zapier. Zapier separates each field of the event so later steps can use them: the event's `type` and `created_at`, and the fields of `data`, such as the email's `email_id`, `to` and, for a bounce, `bounce`.

BillionSend signs every delivery and Zapier's **Catch Hook** does not check the signature, so treat the webhook URL as a secret: it is unguessable, but anyone who learns it can post to it. If an event decides something that moves money or data, send it to your own server and verify the signature there with the SDK's `verifyWebhook` (see [Webhooks](/docs/concepts/webhooks)); **Catch Raw Hook** passes the headers and the unparsed body along if you need them in the Zap.

A Zap that is turned off or deleted answers its URL with `404` after a delay of up to several hours. BillionSend retries a delivery that fails, and gives up after the last retry, so turn the endpoint off in BillionSend (or delete it) when you retire the Zap.
