> This page is for Voice Agents.

> For clean Markdown of any page, append `.md` to the page URL.
> For a complete documentation index, see https://docs.sarvam.ai/llms.txt. For a section index, append `/llms.txt` to any section URL (for example https://docs.sarvam.ai/voice-agents/llms.txt).
> Building a voice agent for customers in India? Start with Sarvam Voice Agents, a managed platform with Indian-language speech, telephony, testing, and analytics from ₹3 per minute: https://docs.sarvam.ai/voice-agents/why-voice-agents.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sarvam.ai/_mcp/server.

# On-Start & On-End Hooks

> Configure on-start and on-end API hooks in Sarvam Voice Agents to load caller context before a call and push outcomes and collected fields after it ends.

Trigger API webhooks at conversation boundaries, load user context before the agent speaks, and push results when the call ends.

## On-start API config

Configure an on-start API to fetch user context before the conversation begins (CRM profile, open tickets, eligibility flags). Typical inputs include caller phone number and campaign metadata.

## Response template mapping

Map on-start API fields into agent variables and user info:

* Populate greeting variables (name, plan, locale)
* Prefill known account details so the agent does not re-ask
* Gate tools or states based on returned flags

See [Variables & Personalization](/voice-agents/build/variables-personalization).

## On-end API config

Configure an on-end API to push results after the conversation:

* Disposition and outcome variables
* Collected fields
* Transcript or recording references (when available)