Reference For: developers

API: webhooks

Operations of the webhooks tag of the native REST API.

Webhook subscriptions

GET /v1/webhooks

Lists subscriptions.

CLI
kyvernon webhooks list

Responses

StatusDescriptionSchema
200OKarray of SubscriptionView

POST /v1/webhooks

Creates a subscription.

CLI
kyvernon webhooks create <name> --url <url> --secret <secret>

Request body

application/json: CreateSubscriptionRequest

NameTypeRequiredDescription
eventTypesarray of stringEvent types (empty = all).
labelsarray of stringLabels.
maxAttemptsinteger (int32) or nullAttempts per event (default 5).
namestringyesName.
secretstringyesShared secret for X-Kyvernon-Signature (HMAC-SHA256); at least 16 bytes.
tenantstring or nullDeliver only the self-service events of this tenant (tenant-N; §5).
urlstringyesTarget URL (https recommended).

Responses

StatusDescriptionSchema
201CreatedSubscriptionView

PUT /v1/webhooks/{id}

Changes a subscription (Kyvernon.Webhook.Manage).

CLI
kyvernon webhooks update <id> --body <json>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the webhook subscription

Request body

application/json: UpdateSubscriptionRequest

NameTypeRequiredDescription
enabledboolean or nullOn or off.
eventTypesarray of string or nullEvent types (empty: all).
labelsarray of string or nullLabels that alarm actions reference.
maxAttemptsinteger (int32) or nullAttempts per event.
namestringyesName.
secretstring or nullNew shared secret (at least 16 bytes); absent keeps the stored one.
tenantstring or nullTenant filter (tenant-N); null removes it.
urlstringyesTarget URL (https://; loopback and private addresses need an allow-list entry).

Responses

StatusDescriptionSchema
200OKSubscriptionView
400Invalid argument; the error body names the fieldErrorBody
404Not found (or not visible to the caller)ErrorBody

DELETE /v1/webhooks/{id}

Deletes a subscription.

CLI
kyvernon webhooks delete <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the webhook subscription

Responses

StatusDescriptionSchema
204Done; no body

GET /v1/webhooks/{id}/dead-letters

Dead letters of a subscription.

CLI
kyvernon webhooks dead-letters <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the webhook subscription

Responses

StatusDescriptionSchema
200OKarray of DeadLetterView

GET /v1/webhooks/{id}/deliveries

The delivery log of a subscription: its last deliveries (at most 50), newest first, test deliveries included. Kept in the replicated store with the subscription.

CLI
kyvernon webhooks deliveries <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the webhook subscription

Responses

StatusDescriptionSchema
200OKarray of WebhookDeliveryView
404Not found (or not visible to the caller)ErrorBody

POST /v1/webhooks/{id}/test

Sends a test event.

CLI
kyvernon webhooks test <id>

Parameters

NameInTypeRequiredDescription
idpathstringyesId of the webhook subscription

Responses

StatusDescriptionSchema
200OKDeliveryResultView

Version 0.1.