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

# Post-Call Variables

> Extract structured data from conversations

## Overview

Post-call variables are the data that you want to extract from the call.

<Note>
  Define what data to extract, and AI automatically extracts it from every call.
</Note>

***

## Post-Call Variables

Post-call variables are information fields that AI extracts from the conversation after the call ends. This data can be used in post-call functions and analytics.

### Variable Types

<Tabs>
  <Tab title="Text">
    **Purpose:** Extract free-form text responses

    **Use Cases:**

    * Call summaries
    * Customer feedback
    * Address or location information
    * Notes or comments

    **Example:**

    ```
    Name: detailed_call_summary
    Description: Detailed summary of the call covering main points discussed, 
                 customer concerns, and action items
    ```

    **AI Behavior:** Extracts and returns free-text response based on your description
  </Tab>

  <Tab title="Selector">
    **Purpose:** Extract one option from multiple choices

    **Use Cases:**

    * Customer type (new/existing/lead)
    * Product interest category
    * Service tier preference
    * Priority level

    **Example:**

    ```
    Name: customer_type
    Description: What type of customer is the user? Options: new_customer, 
                 existing_customer, returning_customer, lead
    ```

    **AI Behavior:** Analyzes conversation and selects the most appropriate option

    <Tip>
      List all possible options in the description for accurate AI extraction.
    </Tip>
  </Tab>

  <Tab title="Boolean">
    **Purpose:** Extract yes/no or true/false answers

    **Use Cases:**

    * Appointment booked (yes/no)
    * Interest expressed (true/false)
    * Follow-up requested
    * Problem resolved

    **Example:**

    ```
    Name: appointment_booked
    Description: Did the user book an appointment during the call?
    ```

    **AI Behavior:** Returns `true` or `false` based on conversation analysis
  </Tab>

  <Tab title="Number">
    **Purpose:** Extract numeric values

    **Use Cases:**

    * Customer age
    * Order quantity
    * Number of attendees
    * Budget amount

    **Example:**

    ```
    Name: user_age
    Description: What is the user's age mentioned during the conversation?
    ```

    **AI Behavior:** Extracts and returns numeric value from conversation
  </Tab>
</Tabs>

***

## Creating Post-Call Variables

<Steps>
  <Step title="Click Add Variable">
    Click the **"Add Variable"** dropdown button
  </Step>

  <Step title="Select Variable Type">
    Choose the appropriate type: Text, Selector, Boolean, or Number
  </Step>

  <Step title="Configure Variable">
    **Name:** Unique identifier (use underscores, e.g., `customer_interest`)

    **Description:** Clear instruction for AI on what to extract

    <Warning>
      The description is critical - it tells the AI exactly what information to look for and how to extract it.
    </Warning>
  </Step>

  <Step title="Save">
    Click Submit to add the variable
  </Step>
</Steps>

### Best Practices for Descriptions

<AccordionGroup>
  <Accordion title="Be Specific" icon="bullseye">
    **Bad:** "Get customer info"

    **Good:** "Extract the customer's full name as mentioned during the conversation. If multiple names are mentioned, use the one they introduce themselves with."
  </Accordion>

  <Accordion title="Define Options for Selectors" icon="list">
    Always list all possible values:

    ```
    Description: What is the customer's preferred contact method? 
    Options: email, phone, whatsapp, sms
    ```
  </Accordion>

  <Accordion title="Provide Context" icon="circle-info">
    Help AI understand edge cases:

    ```
    Description: Did the customer book an appointment? Return true only if a 
    specific date and time was confirmed. Return false if they said "maybe" 
    or "I'll think about it."
    ```
  </Accordion>

  <Accordion title="Use Clear Boolean Questions" icon="toggle-on">
    Frame as yes/no questions:

    * ✅ "Did the customer express interest in the product?"
    * ✅ "Was the call issue resolved?"
    * ❌ "Customer interest" (too vague)
  </Accordion>
</AccordionGroup>

***

## Using Post-Call Variables

### In Post-Call Functions

Access extracted variables in your post-call functions:

**Basic Mode:**

```json theme={null}
{
  "customer_name": "{{customer_name}}",
  "interest_level": "{{interest_level}}",
  "appointment_booked": "{{appointment_booked}}"
}
```

**Advanced Mode (JavaScript):**

```javascript theme={null}
async function processCall(context) {
    // Access post-call variables
    const customerName = context.post_call.customer_name;
    const interestLevel = context.post_call.interest_level;
    const appointmentBooked = context.post_call.appointment_booked;
    
    // Use in your logic
    if (appointmentBooked) {
        // Send confirmation email
        await axios.post('https://api.example.com/send-email', {
            to: customerName,
            type: 'appointment_confirmation'
        });
    }
}
```

***

## Post-Call Model

Choose which AI model processes your post-call analysis.

* **o4-mini** (Default) - Fast and cost-effective
* **gpt-4.1-mini** - Balanced performance
* **gpt-4.1** - Higher accuracy
* **gpt-5-mini** - Latest model
* **gpt-4o** - OpenAI's flagship model

<Note>
  For most use cases, **o4-mini** provides excellent accuracy at the best price.
</Note>

***

***

## Conversion Reason

Define what constitutes a "conversion" for your use case.

**Purpose:** Tell the AI what successful outcome looks like so it can mark calls as converted.

**Examples:**

**E-commerce:**

```
Customer places an order or commits to purchasing a product. 
Mark as converted if they provide payment information or confirm 
the order.
```

**Appointment Booking:**

```
Customer books a confirmed appointment with a specific date and time. 
Do not mark as converted for tentative or "maybe" responses.
```

**Lead Qualification:**

```
Customer expresses strong interest and agrees to a follow-up call with 
the sales team. They must provide their contact information and confirm 
a callback time.
```

<Tip>
  Be specific about what qualifies as a conversion vs. what doesn't. This ensures accurate conversion tracking.
</Tip>

***

## Best Practices

<AccordionGroup>
  <Accordion title="Start Simple" icon="seedling">
    Begin with 3-5 core post-call variables. Add more as you identify needs from actual call data.
  </Accordion>

  <Accordion title="Use Consistent Naming" icon="signature">
    * Use `snake_case` for names
    * Be descriptive: `customer_interest_level` not `interest`
    * Avoid abbreviations unless universally clear
  </Accordion>

  <Accordion title="Review and Refine" icon="rotate">
    After running calls:

    1. Check if variables are being extracted correctly
    2. Refine descriptions if AI misunderstands
    3. Add new variables as patterns emerge
    4. Remove unused variables
  </Accordion>

  <Accordion title="Test with Sample Calls" icon="vial">
    Use the Test Call feature to verify:

    * Variables are extracted as expected
    * Descriptions are clear enough for AI
    * Data types match expectations
  </Accordion>
</AccordionGroup>

***

## Examples by Industry

### E-commerce

**Post-Call Variables:**

```
order_amount (Number): Total order amount in rupees
product_category (Selector): Which product category did customer order from? 
                              Options: electronics, clothing, home, beauty
delivery_preference (Selector): Preferred delivery option? Options: standard, 
                                express, same_day
```

***

### Healthcare/Medical

**Post-Call Variables:**

```
appointment_type (Selector): Type of appointment? Options: consultation, 
                              follow_up, lab_test, emergency
urgency_level (Selector): How urgent is the appointment? Options: routine, 
                          urgent, emergency
insurance_verified (Boolean): Was insurance information verified?
```

***

### Real Estate

**Post-Call Variables:**

```
property_type (Selector): Type of property interested in? Options: apartment, 
                          villa, plot, commercial
budget_range (Text): Budget range mentioned by customer
location_preference (Text): Preferred locations or areas mentioned
viewing_scheduled (Boolean): Was a property viewing scheduled?
```

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Variable not being extracted" icon="question">
    **Possible Causes:**

    * Description is too vague
    * Information wasn't discussed in call
    * Variable type doesn't match data

    **Solutions:**

    * Make description more specific
    * Add examples of what to look for
    * Check call transcript to verify info was mentioned
  </Accordion>

  <Accordion title="Boolean always returns false" icon="toggle-off">
    **Issue:** Too strict criteria

    **Solution:**
    Clarify what counts as true:

    ```
    Bad: "Did customer book appointment?"
    Good: "Did customer book appointment? Return true if a specific date 
           and time was confirmed, even if tentative."
    ```
  </Accordion>

  <Accordion title="Selector choosing wrong option" icon="list-check">
    **Issue:** Options not clearly defined

    **Solution:**
    Provide examples for each option:

    ```
    Description: Customer's experience level? 
    Options: 
    - beginner (first time using, needs guidance)
    - intermediate (some experience, needs occasional help)
    - expert (very familiar, minimal assistance needed)
    ```
  </Accordion>
</AccordionGroup>

***

## Getting Help

<CardGroup cols={2}>
  <Card title="Test Your Configuration" icon="vial">
    Use Test Call to verify variables work as expected
  </Card>

  <Card title="Contact Support" icon="headset">
    Our team can help optimize your post-call variable configuration for your specific use case
  </Card>
</CardGroup>
