> For the complete documentation index, see [llms.txt](https://docs.zenml.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zenml.io/pro/core-concepts/webhooks/custom.md).

# Custom webhooks

Send signed custom events to a ZenML webhook.

The custom webhook provider is a provider-neutral way to send signed JSON events to ZenML. Use it when a service can make HTTP requests but does not have a dedicated ZenML webhook provider.

Custom webhooks preserve the sender's event name and JSON payload for consumers. They do not define a ZenML semantic event catalog. A [custom webhook trigger](/pro/core-concepts/triggers.md#custom-webhook-triggers) can retain the original match-all behavior with an empty configuration or use a [dynamic event filter](/pro/core-concepts/triggers.md#dynamic-event-filters) to match the event name and fields in the authenticated JSON body.

## Create a custom webhook

Create the webhook and copy the generated signing secret:

```bash
zenml webhook create custom-events --type custom
zenml webhook describe custom-events
```

Via the SDK:

```python
from zenml.client import Client
from zenml.webhooks.providers import BuiltinWebhookType

client = Client()
result = client.create_webhook(
    name="custom-events",
    webhook_type=BuiltinWebhookType.CUSTOM,
)

endpoint_url = result.endpoint_url
signing_secret = result.secret.get_secret_value()
```

See [Create a webhook](/pro/core-concepts/webhooks.md#create-a-webhook) for lifecycle and secret-management options shared by all providers.

## Delivery contract

Send an HTTP `POST` request whose body is a valid JSON object. The custom provider reads these headers:

| Header                  | Required | Meaning                                                                       |
| ----------------------- | -------- | ----------------------------------------------------------------------------- |
| `X-ZenML-Signature-256` | Yes      | `sha256=<hex_digest>` calculated with HMAC-SHA256 over the exact request body |
| `X-ZenML-Event`         | Yes      | The sender-defined event name made available to consumers                     |
| `X-ZenML-Delivery`      | No       | A sender-defined delivery identifier for observability                        |

The payload must contain a JSON object at the top level. JSON arrays, scalar values, and malformed JSON return `400 Bad Request`.

## Send a signed event

Set the endpoint and secret captured during creation:

```bash
export WEBHOOK_URL="<endpoint-url-from-zenml>"
export WEBHOOK_SECRET="<signing-secret>"
```

Write the body, calculate its signature with Python, and send the same bytes with `curl`:

```bash
printf '%s' '{"model":"fraud-detector","version":"2026.08.31"}' > custom-event.json

export SIGNATURE="$(python -c 'import hashlib,hmac,os; body=open("custom-event.json","rb").read(); print("sha256=" + hmac.new(os.environ["WEBHOOK_SECRET"].encode(), body, hashlib.sha256).hexdigest())')"

curl -i -X POST "$WEBHOOK_URL" \
  -H "Content-Type: application/json" \
  -H "X-ZenML-Event: model.published" \
  -H "X-ZenML-Delivery: manual-delivery-001" \
  -H "X-ZenML-Signature-256: $SIGNATURE" \
  --data-binary @custom-event.json
```

A valid delivery returns `202 Accepted`. The event name and parsed JSON object are then available to configured consumers. This response does not promise that a consumer matched or completed its work.

If authentication fails, verify that the sent body is byte-for-byte identical to the body used to calculate the signature. See [Understand delivery responses](/pro/core-concepts/webhooks.md#understand-delivery-responses) for the shared response contract.

## Related pages

* [Webhooks](/pro/core-concepts/webhooks.md)
* [Slack webhooks](/pro/core-concepts/webhooks/slack.md)
* [GitHub webhooks](/pro/core-concepts/webhooks/github.md)
* [ClickUp webhooks](/pro/core-concepts/webhooks/clickup.md)
* [Custom webhook triggers](/pro/core-concepts/triggers.md#custom-webhook-triggers)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.zenml.io/pro/core-concepts/webhooks/custom.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
