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

# Webhooks

Webhooks let your server know when [audio](https://docs.beyondwords.io/docs-and-guides/audio.md) and [video](https://docs.beyondwords.io/docs-and-guides/audio/video.md) generation finishes or fails, when a content item is prepared without audio, or when a content item is deleted. You don't need to poll the [API](https://docs.beyondwords.io/docs-and-guides/import-content/sources/api-overview.md). BeyondWords sends a `POST` request with a JSON payload to a URL you add.

Use webhooks to trigger downstream workflows: notify a CMS, update a search index, fetch player data for a native app, or sync content across systems. See the [Pugpig integration guide](https://docs.beyondwords.io/docs-and-guides/integrations/publishing-platforms/pugpig.md) for a common app-distribution pattern.

> [!TIP]
>
> Set a `source_id` when creating content via the [API](https://docs.beyondwords.io/docs-and-guides/import-content/sources/api-overview.md), [WordPress plugin](https://docs.beyondwords.io/docs-and-guides/integrations/publishing-platforms/wordpress.md), or [RSS Feed Importer](https://docs.beyondwords.io/docs-and-guides/import-content/sources/rss.md). The webhook payload includes `source_id`, so you can map notifications back to your CMS article ID without storing BeyondWords `content_id` values.

> [accordion] Use the API
>
> Manage webhooks with the [BeyondWords API](https://docs.beyondwords.io/api-reference/overview.md):
>
> * [List webhooks](https://docs.beyondwords.io/api-reference/webhooks/list.md): `GET /projects/{project_id}/webhooks`
> * [Create a webhook](https://docs.beyondwords.io/api-reference/webhooks/create.md): `POST /projects/{project_id}/webhooks`
> * [Edit a webhook](https://docs.beyondwords.io/api-reference/webhooks/update.md)
> * [Test a webhook](https://docs.beyondwords.io/api-reference/webhooks/test.md)
> * [Delete a webhook](https://docs.beyondwords.io/api-reference/webhooks/delete.md)

## How it works

1. Content is created or updated in BeyondWords through the API, WordPress, Ghost, Magic Embed, RSS Feed Importer, or the BeyondWords dashboard.
2. BeyondWords generates audio and video for the content, or prepares it without audio if `generate_audio` is `false`.
3. When this finishes or fails, or when the content item is deleted, BeyondWords sends a notification to each enabled webhook in your project. Every enabled webhook gets every event.
4. Your endpoint receives a JSON payload and responds with a `2xx` status code.

If BeyondWords can't reach your endpoint, for example because the connection fails or times out, it retries a few times with increasing delays. A response with a `4xx` or `5xx` status code isn't retried.

## Event types

| `action_type` | When it fires |
| - | - |
| [`audio.updated`](#audioupdated) | Generation or regeneration completed successfully |
| [`content.ready`](#contentready) | A content item with `generate_audio` set to `false` was prepared without audio |
| [`audio.error`](#audioerror) | Generation failed |
| [`audio.deleted`](#audiodeleted) | Content item deleted |

> [!WARNING]
>
> Event names reference audio, but they apply to content items as a whole. A content item may include audio outputs, video outputs, or both, and may include article and summary variants. Use `action_type` to determine what happened, then inspect `state`, `media`, and `published` in the payload.

## Set up a webhook

**1. Create a new webhook**

Go to **Settings → Developers → Webhooks** in your project dashboard.

Click **+ Webhook**.

**2. Enter webhook URL**

Enter the HTTPS URL where BeyondWords should send event notifications. This should be an endpoint on your server that accepts `POST` requests with a JSON body.

**3. Set request headers (optional)**

If your endpoint needs authentication or other custom headers, add them here. BeyondWords sends them with every webhook request:

1. Add a **Header name** and **Header value**.
2. To add another header, click **+**.

**4. Enable static IP (optional)**

If your endpoint requires IP allowlisting, enable static IP so webhook requests originate from a fixed address.

1. Switch **Static IP** on.
2. Allowlist the displayed IP address in your firewall, CDN, or server configuration.

> [!NOTE]
>
> Webhook requests are sent from `20.234.8.180` when static IP is enabled.

**5. Enable and save**

Toggle **Enabled** on, then click **Save changes**.

## Test your webhook

### Quick preview with Webhook.site

If you want to see what a webhook payload looks like without building an endpoint, use [Webhook.site](https://webhook.site/). It gives you a temporary URL that logs any requests sent to it.

1. Open [webhook.site](https://webhook.site/) and copy your unique URL.
2. In BeyondWords, go to **Settings → Developers → Webhooks** and paste that URL into **Webhook URL**.
3. Click **Test**, or publish content and wait for a real `audio.updated` event.
4. Return to Webhook.site to inspect the JSON payload, headers, and timestamp.

Webhook.site URLs are public and temporary. Use them for testing only, not production.

### Test from the dashboard

Before going live with your own endpoint:

1. Configure your **Webhook URL** and optional headers.
2. Click **Test**

BeyondWords sends a sample payload to your URL. A successful test means your endpoint returned a `2xx` response. You can also [test a webhook via the API](https://docs.beyondwords.io/api-reference/webhooks/test.md).

## Payload reference

Each notification is a `POST` request with `Content-Type: application/json`. The event type is in `action_type`.

### Common fields

| Field | Description |
| - | - |
| `action_type` | Event type: `audio.updated`, `content.ready`, `audio.error`, or `audio.deleted` |
| `state` | The content item's status when the event was sent: `processed`, `ready`, or `error`. For `audio.deleted`, the status the item had when it was deleted. |
| `id` | Numeric content ID (legacy) |
| `content_id` | Content UUID. Use it with the [player API](https://docs.beyondwords.io/api-reference/player/by-content-id.md). |
| `source_id` | Your external ID for the content (e.g., CMS article ID). Same value as `external_id`. |
| `external_id` | Same as `source_id` |
| `project_id` | Your BeyondWords project ID |
| `title` | Content title |
| `published` | Whether the content is published in BeyondWords |
| `published_at` | Publish timestamp (ISO 8601) |
| `processing_at` | Processing timestamp (ISO 8601) |
| `deleted` | Whether the content item has been deleted |
| `metadata` | Custom metadata object |
| `media` | Array of generated media objects (`id`, `content_type`, `url`, `duration`) |
| `audio_with_intro_outro` | Intro/outro media variants, when configured |
| `image_url` | Featured image URL, if set |
| `is_copy` | Whether this content item is a duplicate of another |

After receiving a webhook, fetch full player data with the [player API](https://docs.beyondwords.io/api-reference/player/by-source-id.md) using `source_id` or [get player by content ID](https://docs.beyondwords.io/api-reference/player/by-content-id.md) using `content_id`.

### audio.updated

Triggered when generation or regeneration completes successfully.

```javascript audio.updated payload expandable theme={null}
{
  "id": 12345,
  "title": "My article",
  "project_id": 67890,
  "external_id": "cms-article-001",
  "state": "processed",
  "metadata": {},
  "media": [
    {
      "id": 987654,
      "content_type": "mp3",
      "url": "https://example.com/audio.mp3",
      "duration": 281
    },
    {
      "id": 987655,
      "content_type": "m3u8",
      "url": "https://example.com/audio.m3u8",
      "duration": 281
    }
  ],
  "audio_with_intro_outro": [],
  "image_url": null,
  "deleted": false,
  "access_key": null,
  "processing_at": "2025-07-02T13:19:39.054Z",
  "published": true,
  "published_at": "2025-07-02T13:19:38.699Z",
  "content_id": "content-uuid",
  "source_id": "cms-article-001",
  "is_copy": false,
  "action_type": "audio.updated"
}
```

### content.ready

Triggered when a content item with `generate_audio` set to `false` is prepared without audio. The payload has the `ready` state and an empty `media` array.

```javascript content.ready payload expandable theme={null}
{
  "id": 12345,
  "title": "Example article title",
  "project_id": 54004,
  "external_id": "article-source-id",
  "state": "ready",
  "metadata": {},
  "media": [],
  "image_url": "https://cdn.example.com/content/article/image.jpg",
  "deleted": false,
  "access_key": null,
  "processing_at": null,
  "published": true,
  "published_at": "2026-07-12T21:30:00.000Z",
  "content_id": "5b4e1683-72e5-4350-a193-4a2a97b08e28",
  "source_id": "article-source-id",
  "is_copy": false,
  "audio_with_intro_outro": [],
  "action_type": "content.ready"
}
```

### audio.error

Triggered when generation fails.

```javascript audio.error payload expandable theme={null}
{
  "id": 12345,
  "title": "My article",
  "project_id": 67890,
  "external_id": "cms-article-001",
  "state": "error",
  "metadata": {},
  "media": [],
  "audio_with_intro_outro": [],
  "image_url": null,
  "deleted": false,
  "access_key": null,
  "processing_at": "2025-07-02T13:19:39.054Z",
  "published": false,
  "published_at": "2025-07-02T13:19:38.699Z",
  "content_id": "content-uuid",
  "source_id": "cms-article-001",
  "is_copy": false,
  "action_type": "audio.error"
}
```

### audio.deleted

Triggered when a content item is deleted.

```javascript audio.deleted payload expandable theme={null}
{
  "id": 12345,
  "title": null,
  "project_id": 67890,
  "external_id": "cms-article-001",
  "state": "processed",
  "metadata": {},
  "media": [],
  "audio_with_intro_outro": [],
  "image_url": null,
  "deleted": true,
  "access_key": null,
  "processing_at": "2025-07-02T13:19:39.054Z",
  "published": true,
  "published_at": "2025-07-02T13:19:38.699Z",
  "content_id": "content-uuid",
  "source_id": "cms-article-001",
  "is_copy": false,
  "action_type": "audio.deleted"
}
```

## Manage webhooks

You can create multiple webhooks per project, for example one for your CMS and one for a partner integration. For each webhook you can:

* Edit the URL, headers, or static IP settings.
* Temporarily disable it with the **Enabled** toggle.
* Delete it when no longer needed.

## Security and reliability

* **Use HTTPS**: Webhook URLs should be served over HTTPS.
* **Authenticate requests**: Configure request headers (such as `Authorization`) in the webhook settings. Validate these on your server before processing the payload. BeyondWords doesn't sign payloads with a shared secret. Authentication uses the headers you add.
* **Allowlist static IPs**: If your endpoint is behind a firewall, enable static IP and allowlist the BeyondWords egress addresses.
* **Respond quickly**: Return a `2xx` response promptly. Process the payload asynchronously if needed.
* **Handle retries**: If a request times out after your server received it, BeyondWords may send it again. Make your handler **idempotent** so duplicate notifications for the same `content_id` and `action_type` don't cause problems.
* **Map content reliably**: Prefer `source_id` over `title` or URLs, which can change.

## FAQs

> [accordion] When does audio.updated fire?
>
> `audio.updated` fires when audio/video generation or regeneration completes successfully, when the content item reaches the `processed` state. It doesn't fire when generation starts, only when it finishes. If generation fails, `audio.error` fires instead. Content items with `generate_audio` set to `false` send `content.ready` instead.

> [accordion] How do I map a webhook back to my CMS article?
>
> Use `source_id` in the payload. This is the external ID you set when creating content (your CMS article ID, WordPress post ID, RSS `guid`, etc.). If you didn't set a `source_id`, use `content_id` and store the mapping in your system, or look up content in the BeyondWords dashboard.

> [accordion] What should my endpoint return?
>
> Return any `2xx` HTTP status code to acknowledge receipt. A `4xx` or `5xx` response counts as a failure and isn't retried. Only connection failures and timeouts are retried.

> [accordion] Do webhooks include video?
>
> Yes. Although event names reference audio, payloads describe the whole content item. Check the `media` array for generated assets. For full player configuration including video, use the [player API](https://docs.beyondwords.io/api-reference/player/by-source-id.md) after receiving the webhook.

> [accordion] Can I use webhooks with Magic Embed or WordPress?
>
> Yes. Any integration that creates content in BeyondWords can trigger webhooks when processing completes. Set a stable `source_id` in your embed code or CMS integration so webhook payloads map cleanly to your articles. See [Magic Embed](https://docs.beyondwords.io/docs-and-guides/import-content/sources/magic-embed.md) and [WordPress](https://docs.beyondwords.io/docs-and-guides/integrations/publishing-platforms/wordpress.md).

> [accordion] How are webhooks different from polling the API?
>
> Webhooks push notifications to your server when events occur. Polling requires your server to repeatedly call the [content API](https://docs.beyondwords.io/api-reference/content/list.md) or [player API](https://docs.beyondwords.io/api-reference/player/by-source-id.md) to check whether processing has finished. Webhooks are more efficient for workflows that need to react promptly when generation completes.

## Get help

If you encounter issues or have questions, [contact support](https://docs.beyondwords.io/docs-and-guides/support.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.