Skip to main content

Webhooks

PATCH/v1/orgs/{org_id}/webhooks/{webhook_id}

Update Webhook

CI or Admin tokenscope: writeoperation_id: webhooks.update

Authentication

Requires a CI- or admin-level token. Runtime tokens are rejected for mutations.

SDK install

pip install znyx-sdknpm install @znyx/sdk

Path parameters

NameTypeRequiredDescription
org_id#pathstringrequired
webhook_id#pathstringrequired

Header parameters

NameTypeRequiredDescription
X-API-Key#headerstring | nulloptional
authorization#headerstring | nulloptional

Request bodyrequired

FieldTypeRequiredDescription
urlstring | nulloptional
eventsstring[] | nulloptional
is_activeboolean | nulloptional

Responses

StatusDescription
200Successful Response
422Validation Error

Response schema

idrequiredstring
org_idrequiredstring
urlrequiredstring
eventsrequiredstring[]
is_activerequiredboolean
created_atrequiredstring
has_secretrequiredboolean

Errors & what triggers them

CodeTriggerFix
400Webhook URL resolves to a private / loopback / reserved IP, or hostname is unresolvable.Use a public HTTPS URL. Local testing requires a tunnel (ngrok, Cloudflare Tunnel).
403Caller is not an org admin.
422events list is empty or contains an unknown event name.

Request

curl -X PATCH 'https://api.znyx.ai/v1/orgs/00000000-0000-0000-0000-000000000000/webhooks/00000000-0000-0000-0000-000000000000' \
  -H 'Authorization: Bearer $ZNYX_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "url": null,
  "events": null,
  "is_active": null
}'

Response

application/json

Successful Response

{
  "id": "string",
  "org_id": "string",
  "url": "string",
  "events": [
    "string"
  ],
  "is_active": false,
  "created_at": "string",
  "has_secret": false
}

Schema: object