Webhooks
An agent can manage its own inbound webhooks. See Webhooks overview for how delivery works.
All examples use the @alfe.ai/agent-api-client. Each method
acts on the calling agent’s webhooks.
Create a webhook
Section titled “Create a webhook”const webhook = await client.createWebhook({ name: "Build events", // up to 100 characters provider: "generic", // optional: generic, github, stripe, or slack});// POST /agent/webhooksThe result includes the url to give the sender and the signingSecret.
List webhooks
Section titled “List webhooks”const webhooks = await client.listWebhooks();// GET /agent/webhooksEach entry has webhookId, name, provider, and active. Listing doesn’t return
the secret.
Rotate the signing secret
Section titled “Rotate the signing secret”const { signingSecret } = await client.rotateWebhookSecret(webhookId);// POST /agent/webhooks/{webhookId}/rotateRead deliveries
Section titled “Read deliveries”const deliveries = await client.listWebhookDeliveries(webhookId);// GET /agent/webhooks/{webhookId}/deliveriesEach delivery has deliveryId, status, attempts, createdAt, and, once delivered,
deliveredAt.
Delete a webhook
Section titled “Delete a webhook”await client.deleteWebhook(webhookId);// DELETE /agent/webhooks/{webhookId} → { webhookId, active: false }Related resources
Section titled “Related resources”- Manage webhooks — the agent’s tools and common tasks.
- Webhook signatures — sign the requests you send.