> ## Documentation Index
> Fetch the complete documentation index at: https://docs.autocalls.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Post-Call Webhook

> Webhook sent after a call is completed containing extracted variables and call data

The Post-Call Webhook is automatically sent to your specified webhook URL after each call is completed. This webhook contains call details, extracted variables, transcript, and optionally the recording URL.

## Webhook Configuration

To enable post-call webhooks:

1. Configure your assistant's webhook URL in the [assistant settings](https://docs.autocalls.ai/ai-assistants/settings/post-call-actions.md#webhook-configuration)
2. Enable "Post call webhook" in the [assistant configuration](https://docs.autocalls.ai/ai-assistants/settings/post-call-actions.md#webhook-configuration)
3. Define post-call variables that the AI should extract

## Request Format

The webhook is sent as a POST request to your configured URL with the following JSON payload:

> [!TIP]
>
> **Using one webhook URL for several assistants?** Every payload carries `assistant_id` (UUID), `assistant_name`, and `type`, so you can route each call without configuring a separate endpoint per assistant.

### Payload Structure

**id** `integer`

Unique identifier of the call

**type** `string`

Channel and direction of the call. One of `inbound`, `outbound`, `web` (browser widget voice call), `whatsapp_inbound`, or `whatsapp_outbound`

**assistant\_id** `string`

Unique identifier (UUID) of the assistant that handled the call

**assistant\_name** `string`

Name of the assistant that handled the call, as shown in the dashboard

**customer\_phone** `string`

Phone number of the customer in E.164 format (e.g., "+1234567890") or null if not available

**assistant\_phone** `string`

Phone number used by the assistant in E.164 format or null if not available

**duration** `integer`

Duration of the call in seconds

**status** `string`

Final status of the call (e.g., "completed", "busy", "failed")

**ended\_by** `string`

Who hung up: `customer` (the caller), `assistant` (hang-up tool or voicemail), or `system` (max duration, silence, or a provider error). `null` on older calls

**extracted\_variables** `object`

Variables extracted by AI based on your post-call schema configuration. String, number, and true/false stay scalars. Tags with multiple values, objects, lists, and JSON arrive as arrays or objects

**Example extracted variables**

**status** `boolean`

Whether the call objective was achieved

**summary** `string`

Call summary in a few words

**custom\_variable** `string|number|boolean|array|object`

Any custom variables you defined in the assistant configuration. Tags with multiple values, objects, lists, and JSON arrive as arrays or objects

### Extracted Variable Types

Each variable in your assistant's post-call schema has a type, and the type decides what arrives in
`extracted_variables`.

| Type | What arrives |
| - | - |
| Text | A string |
| Number | A number |
| True/False | `true` or `false` |
| Tags | The chosen value as a string, or an array of strings when the variable allows several |
| Object | An object with the fields you defined, always the same keys |
| List | An array of objects, one per item the assistant found, empty when there are none |
| JSON | Free-form JSON, shaped by the assistant |

A variable the assistant could not fill arrives as `null`.

```json Structured variables in extracted_variables theme={null}
{
  "extracted_variables": {
    "call_outcome": "interested",
    "objections": ["price", "timing"],
    "delivery_address": {
      "street": "12 Main Street",
      "city": "Austin",
      "postcode": "73301"
    },
    "order_items": [
      { "product": "Pro Plan", "quantity": 2 },
      { "product": "Onboarding", "quantity": 1 }
    ],
    "raw_notes": { "preferred_contact": "email", "follow_up_in_days": 3 },
    "budget": null
  }
}
```

> [!NOTE]
>
> Point your integration at the type rather than at the value. A Tags variable that allows several
> values sends an array even when the assistant picks only one.

**input\_variables** `object`

Variables that were passed to the assistant before the call started

**transcript** `array`

Full transcript of the call, ordered oldest to newest. Note that this is a different shape from the [conversation ended webhook](https://docs.autocalls.ai/api-reference/webhooks/conversation-ended-webhook.md), which uses `role` and `content`

**Transcript entry properties**

**type** `string`

What the entry represents: `transcript` for something that was said, `function` for a mid-call tool call or its result, `event` for a call event. Skip entries that are not `transcript` when rendering a conversation

**text** `string`

What was said. Present on `transcript` entries

**sender** `string`

Who said it: `bot` for the assistant, `human` for the customer

**timestamp** `number`

Unix timestamp (seconds, with decimals) of the entry

**metrics** `object`

Latency and model details for that turn (for example `tts_node_ttfb`, `e2e_latency`, `llm_metadata.model_name`). Keys vary per turn and provider, so treat every one as optional

**formatted\_transcript** `string`

The same conversation as a ready-to-read string, with `AI:` and `Customer:` prefixes and one turn per line. Use this when you just need readable text and do not want to iterate the array

**recording\_url** `string`

URL to download the call recording (only included if "Include recording in webhook" is enabled in [assistant settings](https://docs.autocalls.ai/ai-assistants/settings/post-call-actions.md#webhook-configuration))

**created\_at** `string`

ISO 8601 timestamp when the call was initiated

**finished\_at** `string`

ISO 8601 timestamp when the call was completed (uses updated\_at from the call record)

**lead** `object`

Lead information (only included for campaign calls)

**Lead properties**

**id** `integer`

Unique identifier of the lead

**phone\_number** `string`

Lead's phone number

**variables** `object`

Variables associated with the lead

**status** `string`

Current status of the lead

**call\_tries** `integer`

The number of call attempts made to this lead

**created\_at** `string`

When the lead was created

**updated\_at** `string`

When the lead was last updated

**campaign** `object`

Campaign information (if available)

**Campaign properties**

**id** `integer`

Campaign ID

**name** `string`

Campaign name

**status** `string`

Campaign status

**allowed\_hours\_start\_time** `string`

Campaign allowed start time

**allowed\_hours\_end\_time** `string`

Campaign allowed end time

**allowed\_days** `array`

Campaign allowed days

**max\_calls\_in\_parallel** `integer`

Maximum concurrent calls for campaign

**max\_retries** `integer`

Maximum retry attempts for leads

**retry\_interval** `integer`

Retry interval in minutes

**created\_at** `string`

When the campaign was created

**updated\_at** `string`

When the campaign was last updated

**transfers** `array`

List of transfer calls made during this call (only included if the call has transfers)

**Transfer properties**

**id** `integer`

Unique identifier of the transfer call

**status** `string`

Final status of the transfer call (e.g., "completed", "busy", "failed")

**transfer\_to** `string`

Phone number the call was transferred to in E.164 format

**duration** `integer`

Duration of the transfer call in seconds

**carrier\_cost** `number`

Carrier cost of the transfer call in USD

**transcript** `array`

Raw transcript of the transfer call (null if not available)

**formatted\_transcript** `string`

Human-readable formatted transcript of the transfer call

**recording\_url** `string`

URL to download the transfer call recording (only included if "Include recording in webhook" is enabled and a recording exists)

**created\_at** `string`

ISO 8601 timestamp when the transfer was initiated

**finished\_at** `string`

ISO 8601 timestamp when the transfer was completed

```json 200 Post-Call Webhook Request theme={null}
{
  "id": 12345,
  "type": "outbound",
  "assistant_id": "9c1f8e2a-4d3b-4a17-9f6e-2b5c8d0a7e31",
  "assistant_name": "Sales Agent",
  "customer_phone": "+1234567890",
  "assistant_phone": "+1987654321",
  "duration": 125,
  "status": "completed",
  "ended_by": "customer",
  "extracted_variables": {
    "status": true,
    "summary": "Customer interested in product demo",
    "lead_quality": "high",
    "next_action": "schedule_demo",
    "objections": ["price", "timing"],
    "delivery_address": {
      "street": "12 Main Street",
      "city": "Austin",
      "postcode": "73301"
    }
  },
  "input_variables": {
    "customer_name": "John Doe",
    "product_interest": "Pro Plan"
  },
  "transcript": [
    {
      "text": "Hello! This is Sarah from Autocalls. How are you today?",
      "type": "transcript",
      "sender": "bot",
      "timestamp": 1756812511.315143
    },
    {
      "text": "Hi, I'm doing well, thanks for calling.",
      "type": "transcript",
      "sender": "human",
      "timestamp": 1756812514.104436
    },
    {
      "text": "I'm calling to tell you about our new product features.",
      "type": "transcript",
      "sender": "bot",
      "timestamp": 1756812522.918859
    },
    {
      "text": "That sounds interesting, tell me more.",
      "type": "transcript",
      "sender": "human",
      "timestamp": 1756812525.234567
    }
  ],
  "formatted_transcript": "AI: Hello! This is Sarah from Autocalls. How are you today?\nCustomer: Hi, I'm doing well, thanks for calling.\nAI: I'm calling to tell you about our new product features.\nCustomer: That sounds interesting, tell me more.",
  "recording_url": "https://app.autocalls.ai/storage/recordings/call-12345.mp4",
  "created_at": "2025-01-15T10:30:00.000000Z",
  "finished_at": "2025-01-15T10:32:05.000000Z",
  "transfers": [
    {
      "id": 12346,
      "status": "completed",
      "transfer_to": "+1555123456",
      "duration": 85,
      "carrier_cost": 0.0156,
      "transcript": null,
      "formatted_transcript": "",
      "created_at": "2025-01-15T10:31:00.000000Z",
      "finished_at": "2025-01-15T10:32:25.000000Z"
    }
  ],
  "lead": {
    "id": 789,
    "phone_number": "+1234567890",
    "variables": {
      "source": "website",
      "interest_level": "high"
    },
    "status": "contacted",
    "call_tries": 2,
    "created_at": "2025-01-15T09:00:00.000000Z",
    "updated_at": "2025-01-15T10:32:05.000000Z",
    "campaign": {
      "id": 456,
      "name": "Product Demo Campaign",
      "status": "active",
      "allowed_hours_start_time": "09:00",
      "allowed_hours_end_time": "17:00",
      "allowed_days": ["monday", "tuesday", "wednesday", "thursday", "friday"],
      "max_calls_in_parallel": 5,
      "max_retries": 3,
      "retry_interval": 60,
      "created_at": "2025-01-15T08:00:00.000000Z",
      "updated_at": "2025-01-15T08:00:00.000000Z"
    }
  }
}
```

## Webhook Settings

You can configure the following options for your post-call webhook:

* **Send webhook only on completed**: Only send the webhook for successfully completed calls
* **Include recording in webhook**: Include the `recording_url` field in the payload
* **Custom variables**: Define custom variables that the AI should extract from the conversation

## Delivery and retries

The webhook is a `POST` with a JSON body. Reply with any `2xx` status within 20 seconds; the response body is ignored. Do your processing after you have replied, or hand it to a background task, so a slow handler never turns into a timeout.

If the delivery fails with a temporary error, it is retried automatically with a growing delay:

| Attempt | When |
| - | - |
| 1 | Right after the call ends (or when you ask for a resend) |
| 2 | 30 seconds after attempt 1 failed |
| 3 | 60 seconds after attempt 2 failed |
| 4 | 2 minutes after attempt 3 failed |
| 5 | 5 minutes after attempt 4 failed |

The last attempt is made about 8.5 minutes after the first one. Retried: any `5xx` (for example `502 Bad Gateway` or `503 Service Unavailable`), `408`, `429`, connection failures and timeouts (no response within 20 seconds). Any other `4xx` (for example `400`, `401`, `403`, `404`) is treated as a problem with the endpoint or the payload and is not retried.

After the last failed attempt the delivery is marked as failed. The call page in your dashboard always shows the HTTP status and body of the latest attempt, and the same information is returned as `webhook_response` by [Get call](https://docs.autocalls.ai/api-reference/calls/get-call.md).

### Resending webhooks

You can send the webhook of a call again at any time:

* From the call page: **Re-send webhook** in the post-call webhook section sends the call's data again.
* From the calls list: **Resend Webhooks** evaluates the selected calls again and re-sends their webhooks, up to 500 calls at a time.
* From the API: [Resend call webhooks](https://docs.autocalls.ai/api-reference/calls/resend-call-webhooks.md) sends the data of one or more calls again, up to 500 per request.
* From the AI connector: ask your assistant to resend the webhook of a call.

A resend goes to the webhook URL currently configured on the assistant.

### Handle duplicates

The same call can reach your endpoint more than once: a retry can arrive after a slow attempt that your endpoint did process, and a resend can overlap with an automatic retry. Treat the webhook as at-least-once and de-duplicate on `id`, the unique identifier of the call: process the first payload for an `id` and ignore, or idempotently update on, later ones.

## Important Notes

* The `type` field tells you both the channel and the direction of the call. Text conversations (web widget chat, WhatsApp messages) never arrive here — they use the [conversation ended webhook](https://docs.autocalls.ai/api-reference/webhooks/conversation-ended-webhook.md) instead. Completed WhatsApp **voice** calls do arrive here, as `whatsapp_inbound` or `whatsapp_outbound`
* The `assistant_id` is the assistant's UUID, the same identifier used by the other webhooks and by the API — not the numeric id shown in the dashboard URL
* The `customer_phone` and `assistant_phone` fields can be `null` if the information is not available
* The `recording_url` field is only included if you have enabled "Include recording in webhook" in your [assistant settings](https://docs.autocalls.ai/ai-assistants/settings/post-call-actions.md#webhook-configuration)
* The `lead` object is only included for calls that are part of a campaign
* The `transfers` array is only included for calls that have transfer calls associated with them
* The `extracted_variables` object will contain the variables you defined in your assistant's post-call schema configuration. New types (`tags` with multiple values, `object`, `list`, `json`) are arrays or objects, not strings
* The `ended_by` field is `customer`, `assistant`, or `system` when the engine reported who hung up
* Deliveries are retried on temporary errors and can be resent, so the same `id` can arrive more than once. See [Delivery and retries](#delivery-and-retries)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.