Skip to main content

Webhooks

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

Update Webhook

Bearer token or X-API-Keyscope: adminoperation_id: webhooks.update

Authentication

Send either Authorization: Bearer <token> or X-API-Key: <token>. The caller must hold the "admin" role on the organization. Any org token with sufficient scope. Create tokens from the console or the /v1/orgs/{org_id}/tokens endpoints. Requests without a valid credential are rejected with 401.

SDK install

pip install znyx-sdknpm install @znyx/sdk

Code samples

Request

curl -X PATCH "$ZNYX_API_URL/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

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.-