Create a webhook
Create a webhook. Returns the signing secret (shown only here and on rotate).
Create a webhook. Returns the signing secret (shown only here and on rotate).
ApiKeyAuthAuthorizationBearer <token>Bearer token authentication. Send an API key (a saai_api_-prefixed token) as Authorization: Bearer <token>.
Required permission
manage_webhooksapplication/json- body
Request body for creating a webhook.
name*string1 <= length <= 255url*stringHTTPS endpoint URL. Private, loopback, and cloud-metadata addresses are rejected. Treated as a credential and never returned.
length <= 2048events*array<string>Audit actions to subscribe to, or ["*"] for all of them. An unknown
action is rejected.
1 <= itemsheaders?Custom request headers sent with every delivery. Signing and transport header names are reserved and rejected.
format?stringDefaults to single.
"single""array""ndjson"max_events?integerHow many events one delivery may bundle. Defaults to 1.
int321 <= value <= 100template?stringGo text/template for the delivered body. It must render valid JSON against
vars, which is checked when you save. Empty means the default envelope.
length <= 8192condition?stringCEL expression an event must satisfy to be delivered, checked when you
save against the payload fields of events. Empty delivers every subscribed
event.
length <= 1024destination?stringThe destination this webhook is set up for, such as slack. A label for
display only.
length <= 64vars?Template variables, read as {{ .Vars.<key> }}. Write-only; stored
encrypted. Names must be non-empty and at most 64 characters.
The request has succeeded and a new resource has been created as a result.
application/json- response
Create/rotate response. secret is shown only once, here.
webhook*A configured webhook. The signing secret, the endpoint URL, custom header values, and variable values are never returned.
secret*stringThe whsec_ signing secret. Shown only once.
curl -X POST "https://example.com/webhooks" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "url": "string", "events": [ "string" ] }'{ "webhook": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "url_hint": "string", "events": [ "string" ], "status": "active", "disabled_reason": "circuit_breaker", "failing_since": "2019-08-24T14:15:22Z", "last_delivery_status": "pending", "last_delivery_at": "2019-08-24T14:15:22Z", "format": "single", "max_events": 0, "has_custom_headers": true, "header_keys": [ "string" ], "template": "string", "condition": "string", "destination": "string", "var_keys": [ "string" ], "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" }, "secret": "string"}