settings.webhook:write. In the dashboard
Open Webhooks → Add endpoint
From the website sidebar, open Webhooks and click Add endpoint. You can switch between Visual and JSON input modes — JSON matches the
POST /management/webhooksbody shape.Name and URL
Give the endpoint a clear name (for example “Vercel revalidate”) and an optional description. The URL must be a full
https://address your server can accept withPOST,PUT, orPATCH(default POST).Select triggers
Triggers are OR’d: Macro sends when any selected event fires. Use a quick preset (Static rebuild, All content, Domain monitoring, …) or pick groups/events manually. At least one available event is required.
Signing secret
Leave blank to auto-generate a
whsec_…secret, or paste your own (16–256 characters). The raw secret is shown once at create time — store it with your receiver. See Signing & verifying.Payload mode (optional)
Default is the full Macro envelope. You can send message-only JSON or a custom template — details in Payload & envelope.
Save and test
After create, use Send test event on the row. That delivers
webhook.testand opens the delivery log so you can confirm headers, body, and HTTP status.
Create via Management API
/management/webhooksmt_Create endpoint — returns webhook metadata plus raw secret once.
curl -sS -X POST https://api.macrocontent.dev/management/webhooks \
-H "X-Macro-Token: mt_..." \
-H "Content-Type: application/json" \
-d '{
"name": "Production rebuild",
"url": "https://hooks.example.com/macro",
"events": ["content.published"],
"httpMethod": "POST",
"payloadMode": "envelope"
}'| Name | Type | Required | Description |
|---|---|---|---|
name | string | required | Display name (max 100). |
url | string (URL) | required | Receiver HTTPS URL (max 2048). |
events | string[] | required | At least one available trigger type. |
description | string | optional | Optional note (max 500). |
secret | string | optional | Optional; auto-generates whsec_… when omitted (min 16). |
enabled | boolean | optional | Defaults to true. |
httpMethod | POST | PUT | PATCH | optional | HTTP method for deliveries (default POST). |
payloadMode | envelope | message | custom | optional | Body shape (default envelope). |
payloadTemplate | string | optional | Required for custom mode — Mustache-like {{…}} placeholders. |
payloadContentType | string | optional | Content-Type for the body (default application/json). |
customHeaders | string | optional | Newline KEY=value pairs; cannot override Macro system headers. |
After create
- Toggle enabled on the row to pause deliveries without deleting.
- Edit name, URL, events, method, or payload mode anytime.
- Rotate the secret from the edit UI or
POST /management/webhooks/:id/rotate-secret.