When a call is initiated, whether inbound or outbound, Simple AI follows a sequence of steps before, during, and after the conversation. This page walks through that flow and explains when your application can hook in.

1. Pre-call webhook

If an agent has the pre_call_webhook_url configured and pre_call_webhook_enabled set to true, a POST request is sent to that URL before the call is created. The payload includes information about the call and the agent:

{
  "call": {
    "from_number": "+15551234567",
    "to_number": "+15557654321",
    "direction": "inbound",
    "timestamp": "2024-01-01T12:00:00Z"
  },
  "agent": {
    "id": "agent-uuid",
    "name": "Support Agent"
  }
}

If pre_call_webhook_auth_token is present, it is sent in the Authorization header as a bearer token. The request times out after pre_call_webhook_timeout seconds (default is 5). If the webhook returns a JSON body containing a parameters object, those parameters are merged into the call parameters before creation. Errors or timeouts are ignored and the call proceeds normally.

2. Call created

After the optional pre-call webhook, Simple AI creates the call record and connects the caller to the agent. At this point your application receives the call.started webhook (see Webhooks).

3. Call in progress

During the conversation you may receive call.transcript_update webhooks with incremental transcript data. These allow your application to react in real time.

4. Call completed

When the call ends, Simple AI sends a final call.completed webhook. You can then perform any post-call processing such as updating your records or downloading the call audio.

Understanding this flow helps you integrate pre-call logic and handle real-time events from Simple AI.