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

# Post-Call Webhook

> Receive call data, transcripts, and extracted variables after each call completes.

DialogBot sends a POST request to your configured webhook URL immediately after each call finishes. The payload includes the call transcript, duration, status, and any variables your AI assistant extracted from the conversation.

## Setup

<Steps>
  <Step title="Open assistant settings">
    Go to your assistant in the dashboard and navigate to **Post-Call Actions**.
  </Step>

  <Step title="Enter your webhook URL">
    Paste the URL of your server endpoint that will receive the webhook.
  </Step>

  <Step title="Enable the webhook">
    Toggle **Post call webhook** on.
  </Step>

  <Step title="Define extracted variables (optional)">
    Add custom variables for the AI to extract from each conversation (e.g., `lead_quality`, `next_action`).
  </Step>
</Steps>

<Note>
  You can also enable or disable this webhook via the API using the [Enable Inbound Webhook](/api-reference/assistants/get-assistants) endpoint.
</Note>

## Webhook options

| Option                             | Description                                                            |
| ---------------------------------- | ---------------------------------------------------------------------- |
| **Send webhook only on completed** | Only send for calls with status `completed` — skips busy, failed, etc. |
| **Include recording in webhook**   | Adds a `recording_url` field to the payload                            |

## Payload fields

<ResponseField name="id" type="integer">
  Unique identifier of the call.
</ResponseField>

<ResponseField name="customer_phone" type="string">
  Customer phone number in E.164 format (e.g. `+1234567890`), or `null` if unavailable.
</ResponseField>

<ResponseField name="assistant_phone" type="string">
  Phone number used by the assistant, or `null`.
</ResponseField>

<ResponseField name="duration" type="integer">
  Call duration in seconds.
</ResponseField>

<ResponseField name="status" type="string">
  Final call status: `completed`, `busy`, or `failed`.
</ResponseField>

<ResponseField name="extracted_variables" type="object">
  Variables extracted by the AI based on your post-call schema configuration.

  <Expandable title="Example fields">
    <ResponseField name="status" type="boolean">
      Whether the call objective was achieved.
    </ResponseField>

    <ResponseField name="summary" type="string">
      Short call summary.
    </ResponseField>

    <ResponseField name="custom_variable" type="string | number | boolean">
      Any custom variable you defined.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="input_variables" type="object">
  Variables passed to the assistant before the call started.
</ResponseField>

<ResponseField name="transcript" type="array">
  Array of transcript objects with `text`, `sender` (`bot` or `human`), and `timestamp` fields.
</ResponseField>

<ResponseField name="formatted_transcript" type="string">
  Human-readable transcript with `AI:` and `Customer:` prefixes.
</ResponseField>

<ResponseField name="recording_url" type="string">
  URL to download the call recording. Only present if **Include recording in webhook** is enabled.
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp when the call started.
</ResponseField>

<ResponseField name="finished_at" type="string">
  ISO 8601 timestamp when the call ended.
</ResponseField>

<ResponseField name="lead" type="object">
  Lead information. Only present for campaign calls.

  <Expandable title="Lead fields">
    <ResponseField name="id" type="integer">
      Lead ID.
    </ResponseField>

    <ResponseField name="phone_number" type="string">
      Lead phone number.
    </ResponseField>

    <ResponseField name="variables" type="object">
      Variables associated with the lead.
    </ResponseField>

    <ResponseField name="status" type="string">
      Lead status.
    </ResponseField>

    <ResponseField name="call_tries" type="integer">
      Number of call attempts made.
    </ResponseField>

    <ResponseField name="campaign" type="object">
      Campaign details including name, status, allowed hours, and retry settings.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="transfers" type="array">
  Transfer calls made during this call. Only present if transfers occurred.

  <Expandable title="Transfer fields">
    <ResponseField name="id" type="integer">
      Transfer call ID.
    </ResponseField>

    <ResponseField name="status" type="string">
      Transfer status.
    </ResponseField>

    <ResponseField name="transfer_to" type="string">
      Number the call was transferred to.
    </ResponseField>

    <ResponseField name="duration" type="integer">
      Transfer duration in seconds.
    </ResponseField>

    <ResponseField name="recording_url" type="string">
      Recording URL if available.
    </ResponseField>
  </Expandable>
</ResponseField>

## Example payload

```json theme={null}
{
  "id": 12345,
  "customer_phone": "+1234567890",
  "assistant_phone": "+1987654321",
  "duration": 125,
  "status": "completed",
  "extracted_variables": {
    "status": true,
    "summary": "Customer interested in product demo",
    "lead_quality": "high",
    "next_action": "schedule_demo"
  },
  "input_variables": {
    "customer_name": "John Doe",
    "product_interest": "Pro Plan"
  },
  "transcript": [
    { "text": "Hello, this is Sarah from Intellixent.", "sender": "bot", "timestamp": 1756812511.3 },
    { "text": "Hi, thanks for calling.", "sender": "human", "timestamp": 1756812514.1 }
  ],
  "formatted_transcript": "AI: Hello, this is Sarah from Intellixent.\nCustomer: Hi, thanks for calling.",
  "recording_url": "https://portal.intellixent.ai/storage/recordings/call-12345.mp4",
  "created_at": "2025-01-15T10:30:00.000000Z",
  "finished_at": "2025-01-15T10:32:05.000000Z"
}
```
