curl --request PATCH \
--url https://api.omni.z-api.io/v1/channels/{channelId}/webhooks/{webhookId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "DISABLED"
}
'{
"id": "A1B2C3D4E5F6789012345678901234AB",
"channelId": "019E4C54B1B375A28970B605CA9B03C3",
"instanceId": "019E4C54B1B375A28970B605CA9B03C3",
"url": "https://app.yourcompany.com/webhooks/omni-zapi",
"description": "Main production webhook",
"events": [
"MESSAGE_RECEIVED",
"MESSAGE_STATUS"
],
"status": "ENABLED",
"signing": true,
"secret": "d4e5f6789012345678901234abcdef0123456789abcdef0123456789ab12c3d4",
"auth": {
"type": "BEARER",
"configured": true
},
"payloadFormat": "DEFAULT",
"customAttributes": {},
"createdAt": "2025-01-15T10:30:00.000+0000",
"updatedAt": "2025-01-20T14:00:00.000+0000"
}Update webhook
Update the configuration of an existing webhook
curl --request PATCH \
--url https://api.omni.z-api.io/v1/channels/{channelId}/webhooks/{webhookId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "DISABLED"
}
'{
"id": "A1B2C3D4E5F6789012345678901234AB",
"channelId": "019E4C54B1B375A28970B605CA9B03C3",
"instanceId": "019E4C54B1B375A28970B605CA9B03C3",
"url": "https://app.yourcompany.com/webhooks/omni-zapi",
"description": "Main production webhook",
"events": [
"MESSAGE_RECEIVED",
"MESSAGE_STATUS"
],
"status": "ENABLED",
"signing": true,
"secret": "d4e5f6789012345678901234abcdef0123456789abcdef0123456789ab12c3d4",
"auth": {
"type": "BEARER",
"configured": true
},
"payloadFormat": "DEFAULT",
"customAttributes": {},
"createdAt": "2025-01-15T10:30:00.000+0000",
"updatedAt": "2025-01-20T14:00:00.000+0000"
}Overview
Partially updates a webhook’s configuration. Only the fields sent in the body are updated — the rest remain unchanged.Updating events
When sending theevents field, the list replaces the webhook’s events:
{ "events": ["MESSAGE_RECEIVED", "MESSAGE_STATUS", "CONNECTED"] }
- The list cannot be empty:
"events": []returns400with{"error": "Events cannot be empty when provided"}. To keep the events, omit the field. - An item that is null, blank, or a name that does not exist returns
400with{"error": "events contains an unknown or empty event name"}, and nothing is changed.
events in the responses, and it is kept when you replace the events: the PATCH replaces only the events the API knows. A webhook that only has events like that appears with events: [].Changing the URL
The newurl follows the same rules as on creation (see Webhook URL). It is only checked when it changes: a PATCH without url, or with the URL already stored, is not refused because of it.
Enabling or rotating HMAC signing
If you sendsigning: true, a new secret is generated and returned in this response. Use this also to rotate the secret without recreating the webhook.
{ "signing": true }
secret is returned only in this response. Store it before closing the session.signing: true rotates the secret every time, including when signing was already enabled and you only meant to change another field in the same request. To avoid rotating, omit the signing field.Temporarily disabling
{ "status": "DISABLED" }
DISABLED. To reactivate:
{ "status": "ENABLED" }
status other than ENABLED or DISABLED returns 400 with {"error": "status must be one of [ENABLED, DISABLED]"}.
webhookId is obtained from the Create webhook or List webhooks endpoint.Authorizations
Secret Key generated in the Omni Z-API Security panel
Path Parameters
Channel ID
"019E4C54B1B375A28970B605CA9B03C3"
Webhook ID
"A1B2C3D4E5F6789012345678901234AB"
Body
All fields are optional — only the fields sent are updated.
New destination URL, under the same rules as on creation. It is only checked when it changes.
"https://new-url.yourcompany.com/webhooks/omni-zapi"
New description
New event list. Replaces the events the API knows; a stored event the API does not know yet is kept. Cannot be empty (400).
MESSAGE_RECEIVED, MESSAGE_DELIVERY, MESSAGE_STATUS, RECEIVED_STATUS, RECEIVED_AND_DELIVERY, CONNECTED, DISCONNECTED, PRESENCE_CHAT, INITIAL_DATA, BLOCK DISABLED pauses event delivery without deleting the webhook Any other value returns 400.
ENABLED, DISABLED Enables or rotates the HMAC signature. Generates a new secret returned in the response.
Configures how Omni Z-API authenticates when calling your URL
Show child attributes
Show child attributes
DEFAULT, Z_API, CHATWOOT Response
Webhook updated successfully. The secret field is returned only when signing was enabled in this update.
Unique webhook ID
"A1B2C3D4E5F6789012345678901234AB"
ID of the channel this webhook belongs to
"019E4C54B1B375A28970B605CA9B03C3"
Deprecated — use channelId instead
"019E4C54B1B375A28970B605CA9B03C3"
Event destination URL
"https://app.yourcompany.com/webhooks/omni-zapi"
Webhook description
"Main production webhook"
Configured event types A stored event the API does not know yet is not listed here.
["MESSAGE_RECEIVED", "MESSAGE_STATUS"]
Current webhook status
ENABLED, DISABLED "ENABLED"
Indicates whether HMAC signing is enabled
true
Summary of configured authentication — credentials are not returned for security
Show child attributes
Show child attributes
Format of the delivered payload
DEFAULT, Z_API, CHATWOOT "DEFAULT"
Configured extra attributes
{}
Creation date
"2025-01-15T10:30:00.000+0000"
Last update date
"2025-01-15T10:30:00.000+0000"
64-character hex HMAC secret — returned only when signing is enabled on create or update. Store it securely; it cannot be retrieved later.
"a3f1c2d4e5b6789012345678901234abcdef0123456789abcdef0123456789ab"