Skip to main content

Agent webhooks

Each agent has two webhooks: Configure both on the agent Advance tab. The API Keys page lists each agent’s start-call URL for quick copy. Queuing API outbound dials also respect server.max_concurrent_api_outbound_dials (default 20) for in-flight worker tasks.

1. Start call webhook

Option A — REST + API key

Successful enqueue returns 202:
A background worker dials when global CPS and provider concurrency allow. When the call ends, the call-ended webhook fires as usual.

Option B — Start-call webhook (HMAC)

POST /api/v1/webhooks/agents/{agent_id}/incoming Sign the raw body with your agent secret:
Enable the start-call webhook and rotate the secret from the dashboard (or POST /api/v1/webhooks/agents/{agent_id}/rotate-secret). Body fields: phoneNumber (or to_number / phone_number), optional phone_number_id, optional template variables.

Template variables ({{placeholders}})

Configure attached variables on the agent (defaults always applied to the dial). On each request you can override them:

2. Call ended webhook

When a call finishes, Kupe runs the system lead post-call analysis, then — if call-ended is enabled and the web call / phone call toggles match — POSTs JSON to your CRM URL. Manage config: PUT body example:

Payload (lead schema)

Top-level fields are the system default lead analysis (plus session metadata). The webhook also includes every post-call analysis for the session:
  • post_call_analyses — array of all PCA rows (system default + attached Call Analysis rules + legacy), each with rule_name, source, structured_json / body_text / tool_invocation
  • post_call_analysis_count — length of that array
Lead fields at the top level:
  • customer_name, mobile_number, email, company_name, lead_source
  • call_datetime, call_duration, call_direction (inbound | outbound), call_status, recording_url
  • lead_status, lead_temperature, ai_summary, lead_score
  • next_action, next_follow_up_date, crm_stage
  • send_whatsapp, send_email, reminder_to_sales_team
  • plus call_session_id / agent_id and legacy aliases (call_summary, user_name, …)
Your endpoint should respond quickly with any 2xx.