#how do I fetch some data for agent at call start?

1 messages · Page 1 of 1 (latest)

stuck oracleBOT
#
AI-generated Answer for cauliflower9481

Short answer: use Conversation Initiation Client Data. There are two supported ways, depending on how the call/session starts.

  • Inbound Twilio calls

    • Enable Twilio personalization: set your webhook URL in Agents Platform settings, then on the agent’s Security tab enable “fetching conversation initiation data.” (elevenlabs.io)
    • On each inbound call ElevenLabs sends your webhook a POST with caller_id, agent_id, called_number, and call_sid. Your webhook must quickly return a JSON body of type conversation_initiation_client_data containing:
      • dynamic_variables: key–values for any dynamic variables you’ve defined, and
      • conversation_config_override: optional overrides (prompt, first_message, language, voice_id). (elevenlabs.io)
    • Use HTTPS, authenticate via headers/secrets, and keep response time low to avoid delaying call setup. (elevenlabs.io)
  • Web, SDK, or direct WebSocket sessions

    • Pass conversation_initiation_client_data when you start the session (e.g., first WebSocket message). You can include dynamic_variables, conversation_config_override, and optional custom_llm_extra_body. (elevenlabs.io)

Key concepts and requirements

  • Dynamic variables let you inject per-call values into prompts, first message, and tools; system variables like system__caller_id and system__call_sid are also available. (elevenlabs.io)
  • If you plan to override system prompt, first_message, language, or voice at start, you must first enable those overrides in the agent’s Security settings; otherwise an error is thrown. (elevenlabs.io)
  • React and other SDKs expose “overrides” at conversation start if you’re not using Twilio/webhooks. (elevenlabs.io)

References:

  • Twilio personalization (pre-call webhook, payload, response format, security). (elevenlabs.io)
  • Conversation Initiation Client Data structure. (elevenlabs.io)
  • Agent WebSockets (sending conversation_initiation_client_data at session start). (elevenlabs.io)
  • Dynamic variables (how to define/use; available system variables). (elevenlabs.io)
  • Overrides (enable in Security; fields and behavior). (elevenlabs.io)
  • React SDK
plucky monolith
#

without twilio