Skip to main content

Connection webhooks quickstart

This quickstart walks you through registering a webhook, test-firing it, and receiving a real event about an app connection (an end user’s authenticated link to a third-party app). By the end, you will have a registered endpoint and a stored signing secret ready for signature verification. For brevity, the steps below call an app connection a connection.

Prerequisites

  • A White Label (partner) account that manages at least one connection.
  • An OAuth 2.0 access token with the connection:webhook:write and connection:webhook:read scopes. To obtain one, go to Token exchange: Connection Webhooks API.
  • An HTTPS endpoint that can accept POST requests. The callback_url must use HTTPS.
While this API is in early access, partners need a separate, dedicated client ID and secret to obtain an access token for the connection webhooks endpoints. Reach out to whitelabel@zapier.com to set it up. For the exchange, go to Token exchange: Connection Webhooks API.
Set your token and endpoint as environment variables so the examples below can reuse them.

Step 1: Register a webhook

Create a webhook subscribed to the connection.expiry_scheduled event. The response includes the signing secret. This is the only time the secret is returned, so store it securely.
The response returns 201 Created:
The secret is returned only in this create response. Store it before you move on. If you lose it, delete the webhook and create a new one to get a new secret.

Step 2: Confirm the webhook is registered

List your webhooks to confirm the new one is present and active. The secret is never returned on list or retrieve, only on create.

Step 3: Test the webhook

Before you wait for a real event, test-fire the webhook to confirm your endpoint receives and verifies deliveries. Send a POST to the webhook’s test endpoint:
The API responds 202 Accepted and enqueues the delivery. Zapier then delivers a sample connection.expiry_scheduled event to your callback_url. A test delivery is identical to a real one, except it carries a webhook-test: true header so you can tell them apart. Use it to skip side effects during testing (for example, do not email a real user), while still exercising your signature verification.

Step 4: Receive an event

When one of the connections you manage is scheduled to expire, Zapier POSTs a signed connection.expiry_scheduled event to your callback_url:
Return a 2xx status quickly to acknowledge receipt. A 429 or any 5xx response triggers a retry, so the same event can arrive more than once. For retry and Retry-After behavior, go to Error handling. Before you trust the payload, verify the signature. For the steps, go to Verify signatures.

Step 5: Prompt the user to reconnect

Use the connection_id from the payload to tell the user to start a reconnection flow, so they reauthorize before the connection expires. For the reconnection parameters, go to Connection flow.

Manage a webhook

Pause a webhook without deleting it by setting is_active to false, or update its callback_url:
Delete a webhook when you no longer need it:

Next steps

  1. Verify signatures: confirm each delivery is authentic.
  2. Event payload reference: the fields in a delivered event.
  3. Error handling: API error codes and delivery retry behavior.
  4. Connections API reference: the full CRUD endpoints.