Update webhook
Change a webhook (only the keys sent)
https://s.zo.sa/api/public/v1 /webhooks/{id} webhooks.read_writeNot idempotent (an Idempotency-Key is ignored). The answer shows the values of the headers this request sent, and the secret only when this change made one (security_strategy set to signature or token on a webhook without a secret, and no secret sent).
headers replaces the saved list when sent: send every header you keep, with the mask •••••• as the value of one whose value should stay. Every other key you do not send stays.
Request
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | required | At least 1 |
Request body
A webhook to create (POST: name, event and url required) or change (PATCH: only the keys sent change). The same rules as the dashboard form. Subscribing to an event needs the read scope of its resource (GET /webhooks/events names it); without it the answer is 403 insufficient_scope.
namestringeventstringOne of GET /webhooks/events.urlstringhttps only, a public address (never the server, a LAN or a metadata range).rulestringnullableheadersarray of objectsnullableCustom headers sent with every delivery. Host, Authorization, Content-Type, User-Agent and X-Zo-* are refused.2 fields
keystringrequiredvaluestringrequiredMasked (••••••) on every read; shown only in the answer to the POST or PATCH that sent it. Sending the mask back in a PATCH keeps the stored value.
security_strategystringsecretstringnullableGenerated when left out and the strategy is signature or token.signature_versionintegeris_activebooleanSwitching a webhook back on clears its failure count.
cURL
curl -sS -X PATCH "https://s.zo.sa/api/public/v1/webhooks/7" \
-H "Authorization: Bearer $ZO_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"is_active": true
}'JavaScript
const response = await fetch('https://s.zo.sa/api/public/v1/webhooks/7', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.ZO_API_KEY}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"is_active": true
}),
});
console.log(response.status, await response.json());PHP
<?php
$ch = curl_init('https://s.zo.sa/api/public/v1/webhooks/7');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('ZO_API_KEY'),
'Accept: application/json',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'is_active' => true,
]),
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
echo $status, PHP_EOL, $body, PHP_EOL;Python
import os
import requests
response = requests.patch(
"https://s.zo.sa/api/public/v1/webhooks/7",
headers={
"Authorization": f"Bearer {os.environ['ZO_API_KEY']}",
"Accept": "application/json",
},
json={
"is_active": True,
},
timeout=30,
)
print(response.status_code, response.json())Switches the webhook back on after the receiver is fixed; this also clears its failure count.
{
"data": {
"id": 1,
"name": "string",
"event": "string",
"url": "https://example.com",
"rule": null,
"headers": [
{
"key": "string",
"value": "string"
}
],
"security_strategy": "signature",
"signature_version": 1,
"is_active": true,
"disabled_reason": null,
"failures": 1,
"last_status": null,
"last_delivered_at": null,
"created_at": "2026-11-23T06:01:53Z",
"updated_at": "2026-11-23T06:01:53Z",
"secret": "string"
}
}Example generated from the schema.
Responses
Response schema
dataobjectrequiredA webhook this key created. The secret is never shown here; it comes back once, on create and on rotate.16 fields
idintegerrequirednamestringrequiredeventstringrequiredurlstring (uri)requiredrulestringrequirednullableA rule on the payload attributes, such as total > 100 AND payment_method = `cod`.headersarray of objectsrequired2 fields
keystringrequiredvaluestringrequiredMasked (••••••) on every read; shown only in the answer to the POST or PATCH that sent it. Sending the mask back in a PATCH keeps the stored value.
security_strategystringrequiredsignature_versionintegerrequired1 signs the raw body; 2 signs "{X-Zo-Timestamp}.{raw body}" and sends X-Zo-Timestamp.is_activebooleanrequireddisabled_reasonstringrequirednullablefailures when the webhook switched itself off.failuresintegerrequiredFailed deliveries in a row.last_statusintegerrequirednullableThe HTTP status of the last delivery.last_delivered_atstring (date-time)requirednullablecreated_atstring (date-time)requiredupdated_atstring (date-time)requiredsecretstringPresent only when this change made a new secret.
An error object: {"error": {"code", "message", "fields"}}.
An error object: {"error": {"code", "message", "fields"}}.
An error object: {"error": {"code", "message", "fields"}}.
An error object: {"error": {"code", "message", "fields"}}.
An error object: {"error": {"code", "message", "fields"}}.
An error object: {"error": {"code", "message", "fields"}}.