APIWebhooks

Update a webhook

Update a webhook, including status transitions (pause/resume/re-enable).

PATCH
/webhooks/{webhook_id}

Update a webhook, including status transitions (pause/resume/re-enable).

Authorization

ApiKeyAuth
headerAuthorizationBearer <token>

Bearer token authentication. Send an API key (a saai_api_-prefixed token) as Authorization: Bearer <token>.

Required permission

manage_webhooks

Path Parameters

webhook_id*string
Formatuuid

Request Body

application/json
  1. body

PATCH body. status covers pause/resume/re-enable (only active and paused are accepted; disabled is set by the system). Re-enabling clears disabled_reason and the failure streak.

name?string
Length1 <= length <= 255
url?string

A new endpoint URL. Omit to keep the current one.

Lengthlength <= 2048
events?array<string>
Items1 <= items
status?WebhookStatusUpdate

Status values a client may PATCH. disabled is system-only.

Value in"active""paused"
headers?

Custom request headers. Omit to keep the current set; an empty map clears them. A blank value keeps that header's stored value; to remove a header, send the map without its name.

format?WebhookFormat

How events are encoded in the request body.

Value in"single""array""ndjson"
max_events?integer
Formatint32
Range1 <= value <= 100
template?string

Go text/template for the delivered body; empty clears it, back to the default envelope. It must render valid JSON against vars.

Lengthlength <= 8192
condition?string

CEL expression an event must satisfy to be delivered; empty clears it, back to delivering every subscribed event.

Lengthlength <= 1024
destination?string

The destination this webhook is set up for, such as slack; empty clears it. A label for display only.

Lengthlength <= 64
vars?

Template variables. Omit to keep the current set; an empty map clears them. A blank value keeps that variable's stored value; to remove a variable, send the map without its name.

Response Body

The request has succeeded.

application/json
  1. response

A configured webhook. The signing secret, the endpoint URL, custom header values, and variable values are never returned.

id*uuid
Formatuuid
name*string
Length1 <= length <= 255
url_hint*string

The endpoint as its origin and last four characters, such as https://hooks.slack.com/…7cJa. Many receivers put their credential in the URL, so the URL itself is never returned.

events*array<string>

Audit actions this webhook subscribes to, or ["*"] for all of them.

status*WebhookStatus

Whether a webhook is currently delivering events.

Value in"active""paused""disabled"
disabled_reason?WebhookDisabledReason

Why a webhook was turned off automatically.

Value in"circuit_breaker""gone""template_error"
failing_since?string

When deliveries started failing continuously; cleared once a delivery succeeds.

Formatdate-time
last_delivery_status?WebhookDeliveryStatus

Delivery outcome for a single message.

Value in"pending""retrying""succeeded""failed"
last_delivery_at?string

When the most recent delivery was attempted; absent until the first delivery.

Formatdate-time
format*WebhookFormat

How events are encoded in the request body.

Value in"single""array""ndjson"
max_events*integer
Formatint32
has_custom_headers*boolean

Whether custom request headers are configured. The values themselves are never returned.

header_keys*array<string>

Names of the configured custom headers. Values are never returned. Empty for webhooks saved before header names were recorded, even when has_custom_headers is true.

template?string

Go text/template rendering each event into the delivered body; empty means the default Standard Webhooks envelope.

Lengthlength <= 8192
condition?string

CEL expression an event must satisfy to be delivered; empty means every subscribed event is delivered.

Lengthlength <= 1024
destination?string

The destination this webhook was set up for, such as slack. A label for display; it does not change how events are delivered.

Lengthlength <= 64
var_keys*array<string>

Names of the configured template variables. Values are never returned.

created_at*string
Formatdate-time
updated_at*string
Formatdate-time
curl -X PATCH "https://example.com/webhooks/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{}'
{  "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"}