← Back to documentation

Multicasting a Webhook

Configure one PayloadRelay endpoint to fan out incoming webhooks to email, Slack, Discord, additional webhooks, and Google Sheets at the same time.

7 min read

PayloadRelay endpoints support multiple target destinations. A single incoming request is delivered to every attached target simultaneously — email, Slack, Discord, webhook URLs, and Google Sheets.

Purpose

This guide helps you:

  • Configure an endpoint with multiple targets of different types.
  • Fan out a single webhook to several systems in parallel.
  • Use multicasting for GitHub webhook routing.
  • Understand how delivery outcomes work with multiple targets.

Prerequisites and permissions

  • A PayloadRelay account with multiple relay targets configured.
  • At least two confirmed/active targets (any combination of types).
  • An endpoint to attach them to.

Step-by-step workflow

1. Create the targets

Set up each destination as a separate relay target. For this example, we'll create four:

  1. Email[email protected] (must be confirmed)
  2. Slack webhook#github-events channel
  3. Discord webhook#deployments channel
  4. Webhook URLhttps://api.example.com/webhooks/github

Open Relay targets, create each one, and confirm email targets.

2. Create the multicast endpoint

  1. Open Endpoints and select Create endpoint.
  2. Set the accepted method to POST (or ANY to accept all methods).
  3. Set payload format to JSON.
  4. In Target destinations, add all four targets.
  5. Save and copy the endpoint URL.

3. Send a payload

Code Example
curl -X POST https://api.payloadrelay.com/relay/YOUR_ENDPOINT_ID \
  -H "Content-Type: application/json" \
  -d '{
    "event": "push",
    "repository": "acme/web-app",
    "branch": "main",
    "commit": "abc1234",
    "author": "alice",
    "message": "Fix login redirect bug"
  }'

PayloadRelay accepts the request once and delivers it to all four targets:

  • Email: [email protected] receives an email with the payload fields.
  • Slack: #github-events receives a formatted message.
  • Discord: #deployments receives a formatted message.
  • Webhook: https://api.example.com/webhooks/github receives the full JSON payload.

4. Use case: GitHub webhook fan-out

Point a GitHub repository webhook at your PayloadRelay endpoint to fan out events to multiple systems:

  1. In GitHub, go to your repository → SettingsWebhooksAdd webhook.
  2. Set the Payload URL to your PayloadRelay endpoint URL.
  3. Set Content type to application/json.
  4. Choose which events to receive (e.g. push, pull_request, release).
  5. Save.

Now every GitHub event hits one URL and reaches all your configured targets:

Code Example
GitHub push event
  PayloadRelay endpoint
       ├──► Email: ops team gets notified
       ├──► Slack: #github-events channel
       ├──► Discord: #deployments channel
       └──► Webhook: custom application processes the event

If the endpoint requires authentication, configure a secret in GitHub's webhook settings that matches your endpoint's inbound auth.

5. Selective multicast with multiple endpoints

For more complex routing, create separate endpoints for different event types:

EndpointEventsTargets
push-eventsPush eventsSlack + Webhook
pr-eventsPull request eventsEmail + Slack
release-eventsRelease eventsEmail + Slack + Discord + Webhook

This lets you control which targets receive which types of events.

6. Delivery outcomes with multiple targets

When a payload is delivered to multiple targets, each delivery is tracked independently in Request activity:

  • The inbound request shows a single ACCEPTED outcome.
  • Each target delivery has its own success or failure status.
  • If one target fails (e.g. webhook URL is down), other targets still receive the payload.
  • Retries apply per-target — a failing webhook target retries independently without re-sending to successful targets.

7. Monitoring multicast deliveries

Check delivery status for each target:

  1. Open Request activity.
  2. Find the request by timestamp or endpoint.
  3. The request log shows the inbound outcome and the individual delivery outcomes per target.

Look for:

  • ACCEPTED for the inbound request.
  • Per-target delivery statuses (success/failure with reason).
  • Retry attempts on failed deliveries (if retries are enabled on the endpoint).

Expected result and verification checks

  • A single POST to the endpoint URL triggers deliveries to all attached targets.
  • Each target receives the same payload data.
  • Request activity shows one inbound request with separate delivery entries per target.
  • Failed deliveries to one target do not block deliveries to other targets.

Common issues and fixes

  • One target not receiving: check that the target is attached in Target destinations and is in a valid state (email targets must be Confirmed).
  • Webhook target failing: verify the destination URL is reachable and any required auth is configured on the target.
  • Partial delivery: check Request activity for individual target delivery statuses and error reasons.
  • Duplicate deliveries: ensure the sending system isn't retrying on its end while PayloadRelay is also retrying.

Related guides