The
webhooks client methods are currently in ALPHA. The API may change without notice. A one-time warning is emitted on first use.Get, Update, Delete, Test, ListDeliveryAttempts, and CreateSubscription methods accept either a webhook name or an ID — when a name is passed, the parent Organization (name or ID) is also required so the SDK can resolve the name to a unique ID. Subscriptions are addressed by strict ID. For WebhookAuthTypeHMACSHA256 webhooks the signing secret is returned only once, in the Create response.
List Webhooks
List returns a paginated list of webhooks, most recently created first. Organization, when non-empty, accepts an organization name or ID and restricts results to that organization. Webhooks used as monitor notification channels are included.
Signature:
Get a Webhook
Get returns a single webhook, resolving by name or ID.
Signature:
Create a Webhook
Create creates a new webhook, resolving the owning organization by name or ID. When AuthType is empty the server applies its default (WebhookAuthTypeBearer). For WebhookAuthTypeHMACSHA256 webhooks the response carries SigningSecret — this is the only time the secret is returned, so store it.
Signature:
Update a Webhook
Update patches a webhook, resolving by name or ID. Only non-nil patch fields are sent; nil fields are left unchanged. For nullable fields (Description, AuthToken, Headers), pass a pointer to the empty value to clear the field. AuthType cannot be changed after creation, and an HMAC signing secret cannot be rotated — create a new webhook instead. Returns webhooks.ErrNoUpdateFields without contacting the server when every patch field is nil.
Signature:
Delete a Webhook
Delete removes a webhook, resolving by name or ID. The webhook stops receiving events and is detached from every prompt, evaluator, and monitor it was subscribed to. It returns only an error.
Signature:
Test a Webhook
Test sends a test event to a webhook’s endpoint, resolving the webhook by name or ID. A nil error means the test ran — inspect StatusCode and ErrorMessage on the response for the endpoint’s outcome (StatusCode is 502 when no response was received). Test deliveries are not supported for WebhookAuthTypeHMACSHA256 webhooks.
Signature:
List Delivery Attempts
ListDeliveryAttempts returns a paginated list of a webhook’s delivery attempts, most recent first, resolving the webhook by name or ID. Failed deliveries are retried, so one event may have several attempts.
Signature:
List Subscriptions
ListSubscriptions returns a paginated list of webhook subscriptions, most recently created first. SourceType and SourceID must be set together; webhooks.ErrUnpairedSourceFilter is returned when only one is set. Subscriptions whose webhook has since been deleted are dropped after the page is read, so a page may hold fewer than Limit items while Pagination.HasMore is still true — keep paging until it is false.
Signature:
Create a Subscription
CreateSubscription subscribes a webhook (resolved by name or ID) to one event on one prompt or evaluator. Event must belong to SourceType. To deliver several events to the same webhook, create one subscription per event.
Signature:
Get a Subscription
GetSubscription returns a single webhook subscription by its strict ID. A 404 is returned when the subscription does not exist, its source is not readable, or its webhook has since been deleted.
Signature:
Delete a Subscription
DeleteSubscription removes a webhook subscription by its strict ID. Other subscriptions on the source and the webhook itself are unaffected. It returns only an error.
Signature: