Skip to main content

Lifecycle Webhooks

Lifecycle webhooks publish agent runtime events to an HTTPS endpoint configured on the agent. They are different from channel provider webhooks under /webhooks/{accountId}/{agentId}/{channel}.

Check out the webhook example for how to setup and use.

Agent Config

Configure lifecycle delivery in the encrypted agent config:

{
"hooks": {
"webhook": {
"enabled": true,
"url": "https://example.com/agent-events",
"secret": "...",
"events": [
"agent.started",
"tool.call.started",
"tool.call.finished",
"tool.result",
"subagent.task.finished",
"agent.finished",
"agent.failed"
]
}
}
}
FieldTypeDescription
enabledbooleanEnables lifecycle webhook delivery
urlstringHTTPS endpoint that receives event JSON
secretstringHMAC signing secret
eventsstring[]Optional allow-list; omitted means all lifecycle events

Events

EventEmitted when
agent.startedA model loop starts
agent.step.finishedA Vercel AI SDK step finishes
agent.finishedThe agent produces a final response
agent.failedThe model loop or post-generation handling fails
agent.approval.requiredA tool approval request pauses the turn
tool.call.startedA tool call starts
tool.call.finishedA tool call finishes or fails
tool.resultTool results are available from a finished step
subagent.task.startedA subagent task is dispatched
subagent.task.finishedA subagent task completes or fails

Delivery

Each event is sent as JSON:

{
"type": "tool.call.finished",
"timestamp": "2026-05-17T20:00:00.000Z",
"accountId": "acct_...",
"agentId": "agent_...",
"eventId": "acct:...:api:...",
"conversationKey": "acct:...:conversation:...",
"payload": {
"success": true
}
}

The request is signed with:

X-Webhook-Signature: sha256=<hmac-sha256(secret, raw-json-body)>

Delivery is best-effort. Failures are logged and do not fail the agent turn.