Skip to content

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.

webhooks.ts
const webhook = await client.createWebhook({
name: "Build events", // up to 100 characters
provider: "generic", // optional: generic, github, stripe, or slack
});
// POST /agent/webhooks

The result includes the url to give the sender and the signingSecret.

const webhooks = await client.listWebhooks();
// GET /agent/webhooks

Each entry has webhookId, name, provider, and active. Listing doesn’t return the secret.

const { signingSecret } = await client.rotateWebhookSecret(webhookId);
// POST /agent/webhooks/{webhookId}/rotate
const deliveries = await client.listWebhookDeliveries(webhookId);
// GET /agent/webhooks/{webhookId}/deliveries

Each delivery has deliveryId, status, attempts, createdAt, and, once delivered, deliveredAt.

await client.deleteWebhook(webhookId);
// DELETE /agent/webhooks/{webhookId} → { webhookId, active: false }