# Webhooks

> System API reference, generated from the OpenAPI spec.

Webhook endpoints allow you to configure URLs where Mux will send notifications about events in your environment (e.g. asset ready, live stream active). Requires an access token with `system:read` and/or `system:write` permissions.

HTML version: https://www.mux.com/docs/api-reference/system/webhooks. Full OpenAPI spec: https://www.mux.com/api-spec.json

Operations on this page:

- List webhooks: `GET /system/v1/webhooks`
- Create a webhook: `POST /system/v1/webhooks`
- Retrieve a webhook: `GET /system/v1/webhooks/{WEBHOOK_ID}`
- Update a webhook: `PATCH /system/v1/webhooks/{WEBHOOK_ID}`
- Delete a webhook: `DELETE /system/v1/webhooks/{WEBHOOK_ID}`

## List webhooks

`GET https://api.mux.com/system/v1/webhooks`

Returns a list of webhooks configured for the current environment, sorted by creation time with the most recently created first. The `signing_secret` is not included; it is only returned once, when a webhook is created.

Operation ID: `list-webhooks`. HTML version: https://www.mux.com/docs/api-reference/system/webhooks/list-webhooks

### Query parameters

- `limit` (integer, format: int32, default: 25): Number of items to include in the response
- `page` (integer, format: int32, default: 1): Offset by this many pages, of the size of `limit`

### Response `200`

OK

- `data` (array of object)
  - `id` (string, required): Unique identifier for the webhook.
  - `address` (string, required): The URL where Mux sends webhook notifications.
  - `enabled` (boolean, required): Whether Mux attempts to deliver notifications to this webhook.
  - `created_at` (string, required, format: date-time): Time at which the webhook was created, as an ISO 8601 UTC datetime.
  - `signing_secret` (string): Secret used to verify that webhook payloads were sent by Mux. **Note that this value is only returned once when creating a webhook.**
- `total_row_count` (integer, format: int64): Total number of webhooks in the environment (not the number of items on this page).
- `page` (integer, format: int32): The current page number.
- `limit` (integer, format: int32): The maximum number of items per page.

### Errors

- `400`: Invalid pagination parameters

Every error response has this body:

- `error` (object, required)
  - `type` (string, required): The type of the error
  - `messages` (array of string, required): Friendly messages of errors encountered

## Create a webhook

`POST https://api.mux.com/system/v1/webhooks`

Creates a new webhook for the current environment. New webhooks start out enabled. The `address` must be unique among the environment's webhooks. **The `signing_secret` is only returned in this response and cannot be retrieved again.** Store it securely and use it to verify that webhook payloads were sent by Mux.

Operation ID: `create-webhook`. HTML version: https://www.mux.com/docs/api-reference/system/webhooks/create-webhook

### Request body

- `address` (string, required): The URL where Mux should send webhook notifications. Must be unique among the environment's webhooks.

Example request body:

```json
{
  "address": "https://example.com/webhook"
}
```

### Response `201`

Created

- `data` (object)
  - `id` (string, required): Unique identifier for the webhook.
  - `address` (string, required): The URL where Mux sends webhook notifications.
  - `enabled` (boolean, required): Whether Mux attempts to deliver notifications to this webhook.
  - `created_at` (string, required, format: date-time): Time at which the webhook was created, as an ISO 8601 UTC datetime.
  - `signing_secret` (string): Secret used to verify that webhook payloads were sent by Mux. **Note that this value is only returned once when creating a webhook.**

### Errors

- `400`: A webhook with this address already exists in this environment

Every error response has this body:

- `error` (object, required)
  - `type` (string, required): The type of the error
  - `messages` (array of string, required): Friendly messages of errors encountered

## Retrieve a webhook

`GET https://api.mux.com/system/v1/webhooks/{WEBHOOK_ID}`

Retrieves the details of a webhook that has previously been created. The `signing_secret` is not included; it is only returned once, when the webhook is created.

Operation ID: `get-webhook`. HTML version: https://www.mux.com/docs/api-reference/system/webhooks/get-webhook

### Path parameters

- `WEBHOOK_ID` (string, required): The ID of the webhook.

### Response `200`

OK

- `data` (object)
  - `id` (string, required): Unique identifier for the webhook.
  - `address` (string, required): The URL where Mux sends webhook notifications.
  - `enabled` (boolean, required): Whether Mux attempts to deliver notifications to this webhook.
  - `created_at` (string, required, format: date-time): Time at which the webhook was created, as an ISO 8601 UTC datetime.
  - `signing_secret` (string): Secret used to verify that webhook payloads were sent by Mux. **Note that this value is only returned once when creating a webhook.**

### Errors

- `404`: Webhook not found

Every error response has this body:

- `error` (object, required)
  - `type` (string, required): The type of the error
  - `messages` (array of string, required): Friendly messages of errors encountered

## Update a webhook

`PATCH https://api.mux.com/system/v1/webhooks/{WEBHOOK_ID}`

Updates the address and/or enabled status of an existing webhook. Omitted fields are left unchanged; at least one of `address` or `enabled` must be provided. The new `address` must be unique among the environment's webhooks.

Operation ID: `update-webhook`. HTML version: https://www.mux.com/docs/api-reference/system/webhooks/update-webhook

### Path parameters

- `WEBHOOK_ID` (string, required): The ID of the webhook.

### Request body

- `address` (string): The URL where Mux should send webhook notifications. Must be unique among the environment's webhooks.
- `enabled` (boolean): Whether Mux attempts to deliver notifications to this webhook.

Example request body:

```json
{
  "address": "https://example.com/new-webhook",
  "enabled": false
}
```

### Response `200`

OK

- `data` (object)
  - `id` (string, required): Unique identifier for the webhook.
  - `address` (string, required): The URL where Mux sends webhook notifications.
  - `enabled` (boolean, required): Whether Mux attempts to deliver notifications to this webhook.
  - `created_at` (string, required, format: date-time): Time at which the webhook was created, as an ISO 8601 UTC datetime.
  - `signing_secret` (string): Secret used to verify that webhook payloads were sent by Mux. **Note that this value is only returned once when creating a webhook.**

### Errors

- `400`: No update fields provided, or a webhook with this address already exists in this environment
- `404`: Webhook not found

Every error response has this body:

- `error` (object, required)
  - `type` (string, required): The type of the error
  - `messages` (array of string, required): Friendly messages of errors encountered

## Delete a webhook

`DELETE https://api.mux.com/system/v1/webhooks/{WEBHOOK_ID}`

Deletes an existing webhook. Mux will no longer send event notifications to the configured address, the webhook no longer appears in list or retrieve responses, and its address becomes available for use by a new webhook (which will have a new ID and signing secret).

Operation ID: `delete-webhook`. HTML version: https://www.mux.com/docs/api-reference/system/webhooks/delete-webhook

### Path parameters

- `WEBHOOK_ID` (string, required): The ID of the webhook.

### Response `204`

No Content

### Errors

- `404`: Webhook not found

Every error response has this body:

- `error` (object, required)
  - `type` (string, required): The type of the error
  - `messages` (array of string, required): Friendly messages of errors encountered
