> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-sarvam.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Sarvam - AI Outbound Voice Call

> Trigger AI-driven, multilingual outbound voice calls from MoEngage campaigns using Sarvam's fully managed voice agent platform.

[Sarvam AI](https://www.sarvam.ai/) is an Indian full-stack AI company. Its conversational platform, Sarvam Conversations, provides AI voice agents that speak, listen, and reason in English and Indic languages.

The MoEngage and Sarvam integration enables you to trigger AI-driven outbound phone calls directly from MoEngage campaigns, either from real-time user events such as an abandoned cart, or from scheduled sends such as an upcoming EMI reminder. MoEngage sends a request to Sarvam's Instant Outbound API, and Sarvam places the call and conducts a two-way conversation with your customer in their preferred language.

## Outbound Voice Call × MoEngage

This integration adds conversational voice as an engagement channel alongside push, SMS, email, and WhatsApp, without requiring you to build telephony or conversational AI infrastructure.

With this integration, you can:

* Trigger an outbound AI voice call the moment a campaign event fires.
* Choose the language the conversation opens in, and let the agent switch languages mid-call based on how the customer responds.
* Pass campaign-configured context (customer name, cart value, order ID, amount due, discount code, or any other field your agent needs) with every call using MoEngage personalization attributes.
* Personalize the agent's opening line per user with the Initial Bot Message.
* Receive the outcome of every call, along with call duration and the data captured during the conversation, through a webhook for closed-loop journey orchestration.

## Use Cases

By integrating Sarvam with MoEngage, you can address the following use cases:

* **Cart abandonment follow-up**: Trigger a call that references the cart contents and value, answers product questions, applies a discount code, and helps the shopper complete the purchase.
* **EMI and payment reminders**: Trigger a call ahead of an EMI due date or after a failed payment, inform the customer of the amount due, and guide them to complete the payment.
* **Renewal and retention**: Trigger a call before a subscription or policy renewal, remind the customer of the benefits, and offer a retention incentive where needed.
* **Delivery confirmation and order resolution**: Trigger a call to confirm a delivery slot, inform the customer of a delay, or resolve order issues interactively.
* **Win-back outreach**: Trigger a conversational call to lapsed customers in their preferred language with a personalized offer.

## Prerequisites

<Info>
  To set up the integration, ensure you have the following:

  * **Sarvam account**: An active Sarvam organization and workspace. Note the Organization ID and Workspace ID.
  * **API key**: A workspace API key generated from the Sarvam dashboard, used to authenticate requests from MoEngage.
  * **Published voice agent**: An agent built and published on the Sarvam platform for your use case, with its App ID, App Version, and the list of agent variables it expects (for example, `customer_name` and `cart_value`).
  * **Telephony connection**: A telephony provider connection configured in your Sarvam workspace, with a compliant outbound caller number. Note the Connection ID and Agent Phone Number.
  * **User phone numbers in MoEngage**: A user attribute that holds the mobile number in E.164 format (for example, `+919876543210`).
</Info>

## Step 1: Set Up Your Sarvam Workspace and Voice Agent

Before you connect the app in MoEngage, perform the following steps on the Sarvam dashboard:

1. **Generate credentials**: In your Sarvam workspace settings, note the Organization ID and Workspace ID, and generate an API key. These three values authenticate every call that MoEngage triggers.

   <img src="https://mintcdn.com/moengage-sarvam/6OOQs_Jq7qcd_4Sh/images/sarvam-api-key.png?fit=max&auto=format&n=6OOQs_Jq7qcd_4Sh&q=85&s=8a446ab1b7ea839f5bfe469e30b308f7" alt="Sarvam Settings page showing the Manage API Keys table with the Workspace and Organization IDs and the Create API Key button" width="1024" height="536" data-path="images/sarvam-api-key.png" />

2. **Configure telephony**: With Sarvam onboarding, connect your telephony provider and register the outbound caller number that your customers see. This produces the Connection ID and Agent Phone Number used in the next step.

   <img src="https://mintcdn.com/moengage-sarvam/6OOQs_Jq7qcd_4Sh/images/sarvam-buy-number.png?fit=max&auto=format&n=6OOQs_Jq7qcd_4Sh&q=85&s=50825e25cd1d346a7745ce4534e40eba" alt="Sarvam Buy a phone number dialog listing available numbers with their region and monthly fee" width="1026" height="531" data-path="images/sarvam-buy-number.png" />

3. **Build and publish the agent**: Create the voice agent for your use case, including its conversation design, supported languages, and objection handling. Define the agent variables that the conversation personalizes on (for example, `customer_name`, `cart_value`, `discount_code`, and `preferred_language`). Publishing produces the App ID and App Version.

   <img src="https://mintcdn.com/moengage-sarvam/6OOQs_Jq7qcd_4Sh/images/sarvam-agent-builder.png?fit=max&auto=format&n=6OOQs_Jq7qcd_4Sh&q=85&s=9b9b33c636cb8466a70ee3cfb66f8654" alt="Sarvam agent builder showing the agent greeting, instructions, and the variables used for personalization" width="1049" height="526" data-path="images/sarvam-agent-builder.png" />

Ensure the caller number complies with applicable telecom regulations, such as DLT registration in India. Versioning ensures that live campaigns are not affected by later edits to the agent. For technical details, refer to the [Sarvam documentation](https://docs.sarvam.ai/).

### Where to Find Each Value

Every value that the MoEngage connection form asks for is available on the Sarvam dashboard. The following table describes where to retrieve each one:

| Value              | Where to find it on the Sarvam dashboard                                                                                                                                                                                                     | Format and example                                                |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| Organization ID    | Workspace settings. Also visible in the dashboard URL when a workspace is open, and in the path of every API request that your workspace makes.                                                                                              | UUID, for example `019f3b1a-9e97-707b-…`                          |
| Workspace ID       | Workspace settings, alongside the Organization ID.                                                                                                                                                                                           | UUID, for example `019f3b1a-9e9d-7e38-…`                          |
| API Key            | **Workspace settings > API keys > Generate**. The key is displayed once at generation time. Copy it immediately and store it in a secret manager. If the key is lost, revoke it and generate a new one, then update the MoEngage connection. | Secret string; treat it like a password                           |
| App ID             | The agent's page after publishing (see **Build > Creating an Agent** in the Sarvam docs). Each published agent has its own App ID.                                                                                                           | Name-suffixed identifier, for example `CartRecover-fb7d1564-bef6` |
| App Version        | The agent's page, as the version number assigned at each publish. Use the version you validated in the Playground; newer drafts do not affect it.                                                                                            | Integer, for example `3`                                          |
| Connection ID      | **Deploy > Phone Numbers**, on the telephony connection created during onboarding. One connection can carry multiple caller numbers.                                                                                                         | Identifier, for example `Moengage-ex-156baeff-e262`               |
| Agent Phone Number | **Deploy > Phone Numbers**, listed under the connection. Use a number registered for your brand and compliant with local regulations.                                                                                                        | E.164, for example `+918045695073`                                |

<img src="https://mintcdn.com/moengage-sarvam/6OOQs_Jq7qcd_4Sh/images/sarvam-phone-numbers.png?fit=max&auto=format&n=6OOQs_Jq7qcd_4Sh&q=85&s=e261ff03f0aacbe1211e6d1171a8aabf" alt="Sarvam Phone Numbers page listing the registered caller numbers with their status" width="1029" height="523" data-path="images/sarvam-phone-numbers.png" />

<Tip>
  Before you wire the agent into MoEngage, you can validate it end to end, including test calls to allowlisted numbers, using the Sarvam Playground (**Playground > Test Your Agent**) and test numbers (**Deploy > Test Numbers**).
</Tip>

## Step 2: Connect the App in MoEngage

To connect Sarvam in the App Marketplace, perform the following steps:

1. On the left navigation menu in the MoEngage UI, click **App Marketplace**.

2. On the **App Marketplace** page, search for **Sarvam**.

3. Click the **Sarvam** tile.

   <img src="https://mintcdn.com/moengage-sarvam/WOTDpKH4PV83vTKH/images/sarvam-app-marketplace.png?fit=max&auto=format&n=WOTDpKH4PV83vTKH&q=85&s=5d9c42aacb5f133af40a1f531080317b" alt="App Marketplace search results showing the Sarvam connected app tile" width="3344" height="1514" data-path="images/sarvam-app-marketplace.png" />

4. On the **Sarvam** page, click the **Integrate** tab.

5. Click **+ Add integration**.

6. Under **Connection details**, enter the following details. The form groups these fields under **Authentication** and **Agent & Connection Configuration**:

   | Field                  | Required | Description                                                                                                            |
   | ---------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------- |
   | **Connection name**    | Yes      | A name to identify this connection (for example, Sarvam Outbound call).                                                |
   | **API Key**            | Yes      | The API key generated in your Sarvam workspace. MoEngage sends it as the `X-API-Key` header on every request.          |
   | **Organization ID**    | Yes      | Your Sarvam organization identifier (for example, `019f3b1a-9e97-…`).                                                  |
   | **Workspace ID**       | Yes      | Your Sarvam workspace identifier (for example, `019f3b1a-9e9d-…`).                                                     |
   | **App ID**             | Yes      | The identifier of the published Sarvam agent that this connection triggers (for example, `CartRecover-fb7d1564-bef6`). |
   | **App Version**        | Yes      | The published version of the agent to use (for example, `3`).                                                          |
   | **Connection ID**      | Yes      | The Sarvam telephony connection through which calls are placed (for example, `Moengage-ex-156baeff-e262`).             |
   | **Agent Phone Number** | Yes      | The outbound caller number in E.164 format that customers see (for example, `+918045695073`).                          |

7. Click **Test** to validate the connection.

   <img src="https://mintcdn.com/moengage-sarvam/6OOQs_Jq7qcd_4Sh/images/sarvam-connection-details.png?fit=max&auto=format&n=6OOQs_Jq7qcd_4Sh&q=85&s=420afa8c3c4affdcbfef2f2d26e6b9b8" alt="Connection details form for Sarvam showing the connection name, authentication, and connection configuration fields" width="1016" height="556" data-path="images/sarvam-connection-details.png" />

<Note>
  Any changes to connection details take up to 15 minutes to reflect.
</Note>

<Note>
  The connection is bound to one agent (App ID) and one caller number. To run campaigns with a different agent, for example an EMI reminder agent alongside a cart recovery agent, create an additional connection with that agent's details.
</Note>

## Step 3: Configure a Campaign

To create a Sarvam outbound voice call campaign, perform the following steps:

1. On the left navigation menu in the MoEngage UI, click **Engage**, and then click **Campaigns**.

2. On the **All campaigns** page, click **+ Create campaign**.

3. In the **Create campaign** dialog box, under **Connected Apps**, click **Sarvam**, and then click the most suitable delivery type.

4. In Step 1 (**Target users**), select your audience and define the trigger event (for example, `cart_abandoned` with a 30-minute delay, restricted to users with a valid mobile number).

5. In Step 2 (**Content**), select your Connector (**Make Outbound Call**) and your created connection.

6. Under **Content**, configure the following fields:

   | Section                    | Field                   | Required | Description                                                                                                                                                                                                                                                                                                          |
   | -------------------------- | ----------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | Call Targeting & Overrides | **User Phone Number**   | Yes      | The customer's mobile number in E.164 format. Type `@` to personalize from a user attribute (for example, `{{UserAttribute['Mobile Number']}}`).                                                                                                                                                                     |
   | Call Targeting & Overrides | **Initial Language**    | No       | The language the agent opens the conversation in (for example, English or Hindi). The agent can switch languages mid-call if the customer responds in another supported language.                                                                                                                                    |
   | Call Targeting & Overrides | **Initial Bot Message** | No       | The agent's opening line. Supports personalization (for example, `Hello {{UserAttribute['First Name']}}, welcome to Digital Fortress`). If you leave this field empty, the agent uses its published default opening.                                                                                                 |
   | Context Payload            | **Agent Variables**     | No       | Key-value pairs passed to the agent as conversation context. Keys must match the variables defined on the published agent, and values can be static or personalized (for example, `cart_value` mapped to `{{UserAttribute['cart_value']}}`, or `discount_code` set to `COUP10`). Click **New KV Pair** to add a row. |
   | Callback Configuration     | **Callback URL**        | No       | The HTTPS endpoint that receives the call outcome after the call completes. If you leave this field empty, the call is placed but no outcome is delivered back.                                                                                                                                                      |
   | Callback Configuration     | **Callback Details**    | No       | Key-value pairs sent alongside the callback and echoed back verbatim in the outcome payload. Use them to correlate the outcome to the MoEngage user and campaign (for example, `customer_id` mapped to a user identifier). Click **New KV Pair** to add a row.                                                       |

   <img src="https://mintcdn.com/moengage-sarvam/WOTDpKH4PV83vTKH/images/sarvam-campaign-content.png?fit=max&auto=format&n=WOTDpKH4PV83vTKH&q=85&s=00543292d9b28784af7b6f87df1142c0" alt="Content step of the campaign showing the Make Outbound Call connector, call targeting and overrides fields, agent variables, and callback configuration" width="3348" height="1514" data-path="images/sarvam-campaign-content.png" />

7. In Step 3 (**Schedule and Goals**), configure delivery controls such as DND hours and frequency capping according to your engagement policy.

8. Publish the campaign.

Sarvam places the call as soon as MoEngage sends the request. For One Time and Periodic campaigns, choose a send time that falls within your acceptable calling window, because calls are placed at send time.

<Note>
  Map every agent variable that your published agent expects; unmapped variables fall back to the agent's defaults. Confirm that attribute names typed with `@` resolve to populated user or event attributes, because empty values reach the agent as blank context.
</Note>

## Step 4: Testing and Validation

To confirm that the integration works as expected, perform the following steps:

1. On the **Integrate** tab of the Sarvam app, click **Test** on the connection you created. A successful test confirms that the API Key, Organization ID, and Workspace ID resolve to your Sarvam workspace.

2. In the **Test Campaign** section of the campaign's **Content** step, select an identifier type such as **Email ID**, enter the identifier of a test user whose mobile number you control, and then click **Test**.

   <img src="https://mintcdn.com/moengage-sarvam/WOTDpKH4PV83vTKH/images/sarvam-test-campaign.png?fit=max&auto=format&n=WOTDpKH4PV83vTKH&q=85&s=10e08c2eabcb8603b3c599815e769054" alt="Test Campaign section showing the identifier type dropdown, identifier field, and Test button" width="3160" height="248" data-path="images/sarvam-test-campaign.png" />

3. Confirm that the request returns HTTP 200 with an `attempt_id`, which means MoEngage's request was accepted and the call is being placed.

4. Answer the call and verify the conversation. The agent opens in the configured Initial Language with the personalized Initial Bot Message, and references the mapped agent variables such as name, cart value, and discount code.

5. After the call ends, verify that the outcome was delivered to the configured Callback URL.

6. Where the outcome is written back to MoEngage as a custom event, verify that the event appears on the test user's activity timeline and can be used in journey conditions and conversion goals.

Test campaigns ignore frequency capping, so a test send reaches the number you specify even when the user has met the campaign's capping limits.

The outcome payload includes the call status (`connected`, `no_answer`, `busy`, or `failed`), the duration, the `final_agent_variables` captured during the conversation, an `interaction_id` for retrieving the transcript and recording, and the Callback Details you configured, echoed back verbatim so that you can correlate the outcome to the MoEngage user. To write the outcome back as a custom event such as `voice_call_outcome`, use the [Track Event](/api/event/track-event) API.

## Call Outcomes and Journey Orchestration

Every completed call produces an outcome that identifies whether the call connected, how long it lasted, why it failed, and the data that the agent captured. When you ingest these outcomes into MoEngage as events, you can branch journeys on them. For example, you can suppress a discount SMS when the call connected with positive purchase intent, or fall back to WhatsApp when the call was unanswered.

Each request produces a single dial attempt, so retries are orchestrated in MoEngage. Build a Flow that branches on the outcome event: if `voice_call_outcome` has `status` set to `no_answer` or `busy`, wait an interval, and then trigger the call action again. Use frequency capping or a flow exit condition to bound the number of attempts.

## Reference: The Outcome Webhook Sarvam Sends

After the call completes, Sarvam sends a single POST to the Callback URL configured in the campaign. For the authoritative schema, see the Webhook Payload page in the [Sarvam API reference](https://docs.sarvam.ai/).

You can choose where this outcome is delivered:

* **To MoEngage**: To receive the outcome in MoEngage, contact MoEngage Support for a dedicated endpoint, which is powered by Connected Sources. Enter that endpoint as the Callback URL in the campaign.
* **To your own endpoint**: To process the outcome in your own systems, enter your HTTPS endpoint as the Callback URL in the campaign.

```json Outcome Webhook Payload theme={null}
{
  "attempt_id": "att_8f3a2c…",
  "status": "connected",
  "channel_info": {
    "channel_type": "v2v",
    "channel_provider": "exotel",
    "agent_phone_number": "+918045695073"
  },
  "duration": 94,
  "interaction_id": "int_…",
  "failure_reason": null,
  "final_agent_variables": {},
  "webhook_config": {
    "url": "…",
    "metadata": {
      "customer_id": "<moengage user id>",
      "moe_campaign_id": "<campaign id>"
    }
  },
  "interaction_transcript": [
    { "role": "agent", "en_text": "…" },
    { "role": "user", "en_text": "…" }
  ]
}
```

In this payload, `status` is one of `connected`, `no_answer`, `busy`, or `failed`. The `duration` field is in seconds, and `duration`, `interaction_id`, `final_agent_variables`, and `interaction_transcript` are `null` when the call did not connect.

The following fields matter most when you map outcomes into MoEngage events:

| Field                        | Use                                                                                                                              |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `webhook_config.metadata`    | Carries the MoEngage user identity and campaign reference exactly as passed in the request. Resolve the event against this user. |
| `status`                     | The event's primary attribute. Drives journey branching between `connected`, `no_answer`, `busy`, and `failed`.                  |
| `duration`, `failure_reason` | Secondary attributes for analytics and compliance review, such as numbers registered under a do-not-disturb registry.            |
| `final_agent_variables`      | Data that the agent captured, such as callback preference or purchase intent. This is the richest signal for follow-up journeys. |
| `interaction_id`             | The key for retrieving the full transcript and recording through the Sarvam Analytics API when deeper review is needed.          |

<Note>
  The webhook payload does not carry an event timestamp. When you forward the outcome into MoEngage's Data API, stamp `current_time` in ISO 8601 format at ingestion.
</Note>

## Troubleshooting

The following table describes common issues and their resolutions:

| Symptom                                                 | Likely cause                                                                                                                     | Resolution                                                                                                                                                                                                   |
| ------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| The connection test fails.                              | The API key is invalid or revoked, or the Organization ID and Workspace ID do not match.                                         | Regenerate the key in Sarvam workspace settings and re-enter all three credential values. Ensure that the IDs are copied in full, because they are long UUIDs.                                               |
| The campaign send returns HTTP 422.                     | The request failed validation, most often because of a missing or malformed phone number.                                        | Confirm that the mobile attribute resolves for the user and is in E.164 format, with a country code and no spaces. Check that the App ID and App Version exist as published.                                 |
| HTTP 200 is returned but no call arrives.               | The call was attempted but failed at the telephony layer.                                                                        | Check the `failure_reason` in the outcome webhook. Common causes include numbers registered under DND or NDNC registries and provider-side errors. Consider excluding DND-registered users from the segment. |
| The agent opens with a blank name or the wrong context. | A personalization token resolved to an empty value, or an agent variable key does not match the published agent's variable name. | Verify each agent variable key against the agent's variable list (**Build > Managing Variables**), and confirm that the mapped user or event attributes are populated for the audience.                      |
| The call happens but no outcome is received.            | The Callback URL is empty, unreachable, or rejecting the POST.                                                                   | Confirm that the Callback URL field is populated in the campaign, publicly reachable over HTTPS, and returns a 2xx response. If the field is empty, the call is fire-and-forget by design.                   |
| Calls use the wrong conversation version.               | The App Version in the connection points to an older publish.                                                                    | Update App Version in the connection details to the validated version. Connection detail changes can take a few minutes to propagate.                                                                        |

## Frequently Asked Questions

<AccordionGroup>
  <Accordion title="Can one MoEngage workspace use multiple Sarvam agents?">
    Yes. Each connection is bound to one agent and one caller number, so create one connection per agent (for example, Sarvam Cart Recovery and Sarvam EMI Reminder) and select the appropriate connection when building each campaign.
  </Accordion>

  <Accordion title="Which languages are supported?">
    The languages available on a call are defined by the published agent's configuration on the Sarvam platform. Initial Language selects the opening language, and the agent can switch mid-call when the customer responds in another language that the agent supports.
  </Accordion>

  <Accordion title="Do MoEngage delivery controls apply to voice?">
    Yes. Because MoEngage decides when to send the request, all campaign-level controls such as DND hours, frequency capping, quiet hours, and segment exclusions apply before Sarvam is triggered. Sarvam places the call immediately on receiving the request, so configure your calling-hours policy on the MoEngage side.
  </Accordion>

  <Accordion title="Does Sarvam retry unanswered calls?">
    No. Across all campaign types, one request produces one call attempt, and the outcome, including `no_answer` or `busy`, is reported back through the webhook. Orchestrate retries in a MoEngage Flow as described in [Call Outcomes and Journey Orchestration](#call-outcomes-and-journey-orchestration).
  </Accordion>
</AccordionGroup>
