Skip to main content
Webhooks allow two-way communication: your systems can trigger Kapso agents, and Kapso agents can notify your systems.

Incoming webhooks (triggering agents)

Use incoming webhooks to start an agent’s execution flow from your application (e.g., backend, CRM). Endpoint: Each agent has a unique webhook URL.
Authentication: Include your Project API Key in the X-API-Key request header.
Request body (optional): Send initial data in the JSON payload.
Example (Node.js):

Outbound webhooks (agent notifications)

Configure your agents to send real-time notifications to your systems when important events occur during execution.

Configuration

  1. Navigate to your agent’s “API & Webhooks” settings
  2. Add webhook endpoints for the events you want to monitor
  3. Configure a Secret Key for request verification
  4. Select which events to subscribe to

Supported events

Execution started

agent_execution_startedFired when an agent begins processing

Execution ended

agent_execution_endedFired when an agent completes successfully

Execution failed

agent_execution_failedFired when an agent encounters an error

Handoff required

agent_execution_handoffFired when human intervention is needed

Security & verification

Every webhook request includes an X-Webhook-Signature header containing an HMAC SHA-256 signature of the request body. Verify this signature using your configured Secret Key to ensure authenticity.

Webhook payloads

All webhook payloads include base execution data plus event-specific information:

Base payload structure

Event-specific data

Handoff event includes handoff details:
Failed event includes error information:

Best practices

Important considerations:
  • Respond quickly (within 5 seconds) with a 2xx status code
  • Process webhook data asynchronously if needed
  • Store the webhook secret securely
  • Always verify webhook signatures
  • Implement idempotency handling using the provided idempotency key