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

# Advanced Webhook

> Customize webhook structures to tailor data delivery and seamlessly integrate with your existing workflows. The advanced webhook lets you configure the request method, headers, query parameters, and body.

### Adding a Webhook to Your Campaign

To add a webhook to your campaign, navigate to your campaign settings → **Workflow** tab → **Post-Call Actions** → **Add**.

<Frame>
  <img src="https://mintcdn.com/voxiaai/eI90h_W4qYFdnRrZ/images/documentation/webhook/webhook-workflow-tab.png?fit=max&auto=format&n=eI90h_W4qYFdnRrZ&q=85&s=72c2e1d07c9febae1f1bddb2096ee48f" alt="webhook workflow tab" style={{borderRadius: '10px'}} width="3156" height="1373" data-path="images/documentation/webhook/webhook-workflow-tab.png" />
</Frame>

In the opened window, you can select the action that will be executed after a call. We offer a wide range of integrations that can be used, but for this guide, we'll focus on the **Create Custom Webhook** button in the upper-right corner.

<Frame>
  <img src="https://mintcdn.com/voxiaai/gHnpX7QCnE4IUjNn/images/documentation/webhook/add-webhook.png?fit=max&auto=format&n=gHnpX7QCnE4IUjNn&q=85&s=5d083d02da34dcb3efdfaa3da3648f6d" alt="add webhook" style={{borderRadius: '10px'}} width="3369" height="1548" data-path="images/documentation/webhook/add-webhook.png" />
</Frame>

### Configure an Advanced Webhook

In the webhook editor, you can flexibly configure your HTTP request. First, you need to enter the **URL** where you will send the request and select the **HTTP Method** (`GET`, `POST`, `PUT`, `PATCH`, or `DELETE`). Then configure **Headers** for authorization (if needed) and add **Query Parameters** (if needed) that will be prepended to the URL.

<Frame>
  <img src="https://mintcdn.com/voxiaai/gHnpX7QCnE4IUjNn/images/documentation/webhook/webhook-headers-params.png?fit=max&auto=format&n=gHnpX7QCnE4IUjNn&q=85&s=5615b96b72268c9569d461478c92b156" alt="webhook headers and parameters" style={{borderRadius: '10px'}} width="3341" height="1516" data-path="images/documentation/webhook/webhook-headers-params.png" />
</Frame>

Next, you can configure the **Request Body**. First, select one of the available formats: **Form Data**, **JSON**, or **Raw**.

<Frame>
  <img src="https://mintcdn.com/voxiaai/eI90h_W4qYFdnRrZ/images/documentation/webhook/webhookbody-formats.png?fit=max&auto=format&n=eI90h_W4qYFdnRrZ&q=85&s=c3f7ad2eee1c5cfd2b27b6657a0b9743" alt="webhook body formats" style={{borderRadius: '10px'}} width="3448" height="1635" data-path="images/documentation/webhook/webhookbody-formats.png" />
</Frame>

After selecting the format, you need to write the request body itself. Here you can use the standard variables we provide as values, and custom variables configured through **Key Questions** will also be available. (Learn more about Key Questions [here](/documentation/using-callers/key-questions)).

<Frame>
  <img src="https://mintcdn.com/voxiaai/eI90h_W4qYFdnRrZ/images/documentation/webhook/webhook-variables.png?fit=max&auto=format&n=eI90h_W4qYFdnRrZ&q=85&s=56cada67f2049785efcdbc973f3d71bd" alt="webhook variables" style={{borderRadius: '10px'}} width="2079" height="1146" data-path="images/documentation/webhook/webhook-variables.png" />
</Frame>

### Import cURL Configuration

In addition to manual configuration, you can set up the entire request by importing a cURL command.

<Frame>
  <img src="https://mintcdn.com/voxiaai/gHnpX7QCnE4IUjNn/images/documentation/webhook/webhook-cURL.png?fit=max&auto=format&n=gHnpX7QCnE4IUjNn&q=85&s=1d6dda2bd26d20731e1861854ae5236a" alt="webhook cURL import" style={{borderRadius: '10px'}} width="3441" height="1565" data-path="images/documentation/webhook/webhook-cURL.png" />
</Frame>

To do this, find the **Import** button in the upper-right corner, and in the opened window, paste your cURL command and click the **Import** button again.

<Frame>
  <img src="https://mintcdn.com/voxiaai/gHnpX7QCnE4IUjNn/images/documentation/webhook/webhook-cURL-example.png?fit=max&auto=format&n=gHnpX7QCnE4IUjNn&q=85&s=9ebfe8c8796846a5f250e374af79636c" alt="webhook cURL example" style={{borderRadius: '10px'}} width="3346" height="1538" data-path="images/documentation/webhook/webhook-cURL-example.png" />
</Frame>

All necessary values will automatically populate in the method, URL, headers, parameters, and body.

<Frame>
  <img src="https://mintcdn.com/voxiaai/gHnpX7QCnE4IUjNn/images/documentation/webhook/webhook-cURL-example-done.png?fit=max&auto=format&n=gHnpX7QCnE4IUjNn&q=85&s=f37a00bee2eebc46d35f7e7c28d0feae" alt="webhook cURL imported" style={{borderRadius: '10px'}} width="3338" height="1537" data-path="images/documentation/webhook/webhook-cURL-example-done.png" />
</Frame>

### Testing Your Webhook

After configuring the request, you can test it by clicking the **Send Test Request** button in the upper-right corner. In the space on the right below this button, you'll see a detailed response with the status code and body.

<Frame>
  <img src="https://mintcdn.com/voxiaai/gHnpX7QCnE4IUjNn/images/documentation/webhook/webhook-response.png?fit=max&auto=format&n=gHnpX7QCnE4IUjNn&q=85&s=fb7c8b6acb65ecebe965ab58a448ff76" alt="webhook response" style={{borderRadius: '10px'}} width="3334" height="1531" data-path="images/documentation/webhook/webhook-response.png" />
</Frame>

### Configuring Webhook Triggers

Finally, you need to define when the webhook will be sent. You can configure the webhook to trigger based on specific call statuses (for example, send the webhook only to interested leads).

<Frame>
  <img src="https://mintcdn.com/voxiaai/eI90h_W4qYFdnRrZ/images/documentation/webhook/webhook-statuses.png?fit=max&auto=format&n=eI90h_W4qYFdnRrZ&q=85&s=62d59048f355c0632eecabc07381b384" alt="webhook statuses" style={{borderRadius: '10px'}} width="2073" height="1192" data-path="images/documentation/webhook/webhook-statuses.png" />
</Frame>

### Webhook payload example

Use the example below as a template when mapping fields inside downstream systems:

```json webhook.json theme={null}
{
  "callStatus": "COMPLETED",
  "createdAt": "2024-03-11T14:56:41.642Z",
  "phoneFrom": "+15555551234",
  "phoneTo": "+15555554321",
  "status": "INTERESTED",
  "postProcessStatus": "INTERESTED",
  "hangUpReason": "CALL_FINISHED",
  "duration": 128,
  "totalDuration": 150,
  "isIncoming": false,
  "contactStatus": {
    "callMeLater": false,
    "doNotCall": false,
    "wrongNumber": false
  },
  "conversationFlow": [],
  "summary": {
    "Inquiry Asked": {
      "description": "Interested in learning more about our services",
      "options": [],
      "order": 1,
      "type": "YES_NO",
      "value": false
    }
  },
  "campaign": {
    "id": "{campaignId}",
    "name": "{campaignName}"
  },
  "id": "{callId}",
  "contact": {
    "id": "{contactId}",
    "name": "John",
    "phoneNumber": "+1234567890",
    "data": {
      "email": "john@callers.ai",
      "position": "Product Manager",
      "company": "Callers"
    }
  },
  "twilio": {
    "accountSid": "{accountSid}",
    "callSessionId": "{callSessionId}"
  },
  "organizationId": "{organizationId}",
  "account": {
    "id": "{organizationId}",
    "name": "{organizationName}"
  },
  "transcript": [
    {
      "content": "Hello, this is Callers. How can I assist you today?",
      "role": "Assistant"
    },
    {
      "content": "Hi, can you tell me more about your services?",
      "role": "user"
    },
    {
      "content": "Certainly! We offer personalized AI calling services. Would you like to schedule a demo?",
      "role": "Assistant"
    },
    {
      "content": "Yes, that sounds great. Thank you!",
      "role": "user"
    },
    {
      "content": "You're welcome! I'll set that up and send you a confirmation. Have a great day!",
      "role": "Assistant"
    }
  ],
  "interested": {
    "description": "The caller showed interest in scheduling a demo, indicating a positive engagement.",
    "reached": true
  },
  "successCriteria": {
    "goalReached": true,
    "description": "Customer agreed to schedule a demo",
    "name": "Demo Scheduled",
    "reason": "Positive response to scheduling request",
    "type": "INTERESTED"
  },
  "events": [
    {
      "type": "SMS",
      "data": {
        "sent": true,
        "status": "queued",
        "sentAt": "2024-11-28T22:37:01.000Z",
        "sentTo": "+1999999999",
        "uri": "{uri}",
        "smsSid": "{smsSid}",
        "sentFrom": "+1999999999",
        "text": "{smsTemplateText}"
      }
    },
    {
      "type": "FORWARD",
      "data": {
        "phoneNumber": "+1999999999",
        "contactAsCallerId": true
      }
    }
  ],
  "webhookUrl": "{webhookUrl}",
  "webhookEvent": "CONNECTED",
  "webhookEvents": [
    "HANG_UP",
    "CONNECTED",
    "POST_PROCESSING_FINISHED:NOT_INTERESTED",
    "POST_PROCESSING_FINISHED:CALL_ME_LATER",
    "POST_PROCESSING_FINISHED:INTERESTED",
    "POST_PROCESSING_FINISHED:VOICE_MAIL"
  ],
  "webhookStatuses": [
    "INTERESTED",
    "NOT_INTERESTED",
    "CALL_ME_LATER",
    "WRONG_NUMBER",
    "DO_NOT_CALL",
    "COMPLETED",
    "FAILED",
    "VOICE_MAIL",
    "BUSY",
    "NO_ANSWER"
  ],
  "isTestCall": false,
  "sessionId": "{sessionId}",
  "slackUrl": "{slackUrl}"
}
```

### Webhook fields reference

Refer to the table below for every field that can appear in the payload:

<table>
  <thead>
    <tr>
      <th width="191">Field</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td><code>createdAt</code></td>
      <td>Timestamp when the call was initiated in ISO 8601 format.</td>
    </tr>

    <tr>
      <td><code>phoneFrom</code></td>
      <td>Phone number from which the call originated.</td>
    </tr>

    <tr>
      <td><code>status</code></td>

      <td>
        <p>Composite status of a call. It includes the call status, the reason for call hang up, and the
        candidate status. </p>

        <p />

        <p><strong>Call progress status:</strong></p>

        <ul>
          <li><code>NEW</code></li>
          <li><code>IN\_PROGRESS</code></li>
          <li><code>BUSY</code></li>
          <li><code>NO\_ANSWER</code></li>
          <li><code>VOICE\_MAIL</code></li>
          <li><code>FAILED</code></li>
        </ul>

        <p><strong>Call connection status:</strong></p>

        <ul>
          <li><code>USER\_REQUESTED\_HANGUP</code></li>
          <li><code>ADMIN\_MANUAL\_HANGUP</code></li>
          <li><code>VOICE\_MAIL\_DETECTED</code></li>
          <li><code>SILENCE\_DETECTED</code></li>
          <li><code>USER\_MANUAL\_HANGUP</code></li>
          <li><code>CONVERSATION\_LLM\_TECHNICAL\_ISSUES</code></li>
          <li><code>OTHER\_TECHNICAL\_ISSUES</code></li>
          <li><code>CALL\_FINISHED</code></li>
          <li><code>CALL\_FORWARDED</code></li>
          <li><code>UNKNOWN</code></li>
          <li><code>SOCKET\_DISCONNECTED</code></li>
        </ul>

        <p><strong>Contact response to call:</strong></p>

        <ul>
          <li><code>INTERESTED</code>: The contact expressed interest in the purpose of the call.</li>
          <li><code>NOT\_INTERESTED</code>: The contact is not interested in the purpose of the call.</li>
          <li><code>CALL\_ME\_LATER</code>: The contact requested a follow-up call at a later time.</li>
          <li><code>PENDING</code>: The contact has been returned to the call queue for further attempts.</li>
          <li><code>WRONG\_NUMBER</code>: The number dialed did not correspond to the intended contact.</li>
          <li><code>DO\_NOT\_CALL</code>: The contact requested not to receive future calls.</li>
        </ul>

        <p />
      </td>
    </tr>

    <tr>
      <td><code>callStatus</code></td>

      <td>
        <p>Call status:</p>

        <ul>
          <li><code>NEW</code></li>
          <li><code>IN\_PROGRESS</code></li>
          <li><code>FAILED</code></li>
          <li><code>COMPLETED</code>: The user answered and the call ended successfully.</li>
          <li><code>NO\_ANSWER</code></li>
          <li><code>BUSY</code></li>
          <li><code>VOICE\_MAIL</code></li>
          <li><code>DO\_NOT\_CALL\_REGISTRY\_MATCHED</code></li>
        </ul>
      </td>
    </tr>

    <tr>
      <td><code>postProcessStatus</code></td>

      <td>
        <p>Candidate status for that call:</p>

        <ul>
          <li><code>INTERESTED</code> </li>
          <li><code>NOT\_INTERESTED</code></li>
          <li><code>CALL\_ME\_LATER</code></li>
          <li><code>WRONG\_NUMBER</code></li>
          <li><code>DO\_NOT\_CALL</code></li>
        </ul>
      </td>
    </tr>

    <tr>
      <td><code>events</code></td>

      <td>
        <p>Details about specific call events:</p>

        <ul>
          <li>
            <p><code>SMS</code></p>

            <ul>
              <li>Data regarding origin, destination and content</li>
            </ul>
          </li>

          <li><code>FORWARDED CALL</code></li>

          <li>
            <p><code>MEETING</code></p>

            <ul>
              <li>Data regarding slot booked, date sent and destination email.</li>
            </ul>
          </li>
        </ul>
      </td>
    </tr>

    <tr>
      <td><code>webhookUrl</code></td>
      <td>URL to which the Webhook data is sent post-call.</td>
    </tr>

    <tr>
      <td><code>webhookEvent</code></td>

      <td>
        <p>Event related to the webhook trigger:</p>

        <ul>
          <li><code>DIALING</code></li>
          <li><code>CONNECTED</code></li>
          <li><code>FAILED</code></li>
          <li><code>COULD\_NOT\_CONNECT:BUSY</code></li>
          <li><code>COULD\_NOT\_CONNECT:NO\_ANSWER</code></li>
          <li><code>FORWARDED</code></li>
          <li><code>HANG\_UP</code></li>
          <li><code>POST\_PROCESSING\_FINISHED:VOICE\_MAIL</code></li>
          <li><code>POST\_PROCESSING\_FINISHED:INTERESTED</code></li>
          <li><code>POST\_PROCESSING\_FINISHED:NOT\_INTERESTED</code></li>
          <li><code>POST\_PROCESSING\_FINISHED:WRONG\_NUMBER</code></li>
          <li><code>POST\_PROCESSING\_FINISHED:CALL\_ME\_LATER</code></li>
          <li><code>POST\_PROCESSING\_FINISHED:DO\_NOT\_CALL</code></li>
          <li><code>FORWARDED\_CALL\_FINISHED</code></li>
        </ul>
      </td>
    </tr>

    <tr>
      <td><code>webhookEvents</code></td>
      <td>List of selected events for triggering the webhook.</td>
    </tr>

    <tr>
      <td><code>hangUpReason</code></td>

      <td>
        <p>Reason for the call termination:</p>

        <ul>
          <li><code>USER\_REQUESTED\_HANGUP</code>: User asked to hang up.</li>
        </ul>

        <ul>
          <li><code>ADMIN\_MANUAL\_HANGUP</code>: Call ended by an admin.</li>
        </ul>

        <ul>
          <li><code>USER\_MANUAL\_HANGUP</code>: User manually ended the call.</li>
        </ul>

        <ul>
          <li><code>CALL\_FINISHED</code>: Call ended after the completion of all interactions.</li>
          <li><code>CALL\_FORWARDED</code>: Call transferred to a designated phone number.</li>
        </ul>
      </td>
    </tr>

    <tr>
      <td><code>duration</code></td>
      <td>Duration of the call with Callers' agent in seconds.</td>
    </tr>

    <tr>
      <td><code>totalDuration</code></td>
      <td>Total duration of the call including the forwarded call duration in seconds.</td>
    </tr>

    <tr>
      <td><code>contactStatus</code></td>

      <td>
        <p>Object indicating the contact's preferences:</p>

        <ul>
          <li><code>callMeLater</code>: Boolean indicating if the contact requested a callback later.</li>
        </ul>

        <ul>
          <li><code>doNotCall</code>: Boolean indicating if the contact requested not to be called again.</li>
        </ul>

        <ul>
          <li><code>wrongNumber</code>: Boolean indicating if the contact reported this as a wrong number.</li>
        </ul>
      </td>
    </tr>

    <tr>
      <td><code>summary</code></td>
      <td>Object summarizing the <a href="/documentation/using-callers/key-questions">Key Questions</a> made during the call.</td>
    </tr>

    <tr>
      <td><code>campaign</code></td>

      <td>
        <p>Information about the campaign associated with the call:</p>

        <ul>
          <li><code>id</code>: Campaign id.</li>
        </ul>

        <ul>
          <li><code>name</code>: Name of the campaign.</li>
        </ul>
      </td>
    </tr>

    <tr>
      <td><code>id</code></td>
      <td>Unique identifier for the call.</td>
    </tr>

    <tr>
      <td><code>contact</code></td>

      <td>
        <p>Details about the person contacted:</p>

        <ul>
          <li><code>id</code>: Contact's identifier.</li>
          <li><code>name</code>: Contact's name.</li>
        </ul>

        <ul>
          <li><code>phoneNumber</code>: Contact's phone number.</li>
        </ul>

        <ul>
          <li><code>data</code>: Contains additional properties that can be used as variables in the script
          during the call</li>
        </ul>
      </td>
    </tr>

    <tr>
      <td><code>twilio</code></td>

      <td>
        <p>Twilio information:</p>

        <ul>
          <li><code>accountSid</code>: Unique identifier for the Twilio account.</li>
        </ul>

        <ul>
          <li><code>callSessionId</code>: Unique session identifier for the call.</li>
        </ul>
      </td>
    </tr>

    <tr>
      <td><code>organizationId</code></td>
      <td>Unique identifier for the organization.</td>
    </tr>

    <tr>
      <td><code>transcript</code></td>
      <td>Array of dialogue exchanges during the call, with each entry detailing the content spoken and the role
      of the speaker.</td>
    </tr>

    <tr>
      <td><code>interested</code></td>

      <td>
        <p>Object detailing whether the caller expressed interest in the services:</p>

        <ul>
          <li><code>description</code>: The Interest Criteria defined by the user for the campaign.</li>
        </ul>

        <ul>
          <li><code>reached</code>: Boolean indicating whether the Interest Criteria was reached.</li>
        </ul>
      </td>
    </tr>

    <tr>
      <td><code>successCriteria</code></td>

      <td>
        <p>Object detailing the success criteria evaluation for the call:</p>

        <ul>
          <li><code>goalReached</code>: Boolean indicating if the success criteria was met (true/false)</li>
        </ul>

        <ul>
          <li><code>description</code>: Description of the success criteria used for this call</li>
        </ul>

        <ul>
          <li><code>name</code>: The given name for the success criteria</li>
        </ul>

        <ul>
          <li><code>reason</code>: The reason for choosing this success criteria</li>
        </ul>

        <ul>
          <li><code>type</code>: The group the success criteria belongs to - either <code>INTERESTED</code> or <code>NOT\_INTERESTED</code></li>
        </ul>
      </td>
    </tr>

    <tr>
      <td><code>isTestCall</code></td>
      <td>Boolean indicating if the call was a test call.</td>
    </tr>

    <tr>
      <td><code>slackUrl</code></td>
      <td>Webhook Url if the account is integrated with Slack.</td>
    </tr>
  </tbody>
</table>

### Network Requirements

Callers sends webhooks from the following IP addresses:

<Note>
  If your systems are behind a firewall, whitelist these IP addresses to ensure webhook delivery:

  ```copy theme={null}
  35.245.204.86
  35.221.61.75
  ```
</Note>

These IP addresses are also used for action dispatching when your campaigns trigger custom actions (like API calls to external services).
