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

# Update Persona

> Partially update the persona section of an agent

## Update Agent Persona

Partially update the **persona** section of an agent. Only the fields you include are deep-merged into the existing configuration; omitted fields are left unchanged.

The persona section controls the agent's **identity** (system prompt, greeting), **AI providers** (STT / LLM / TTS), **actions**, **memories**, and **metadata**.

***

## Path Parameters

<ParamField path="agent_id" type="string" required>
  UUID of the agent to update.
</ParamField>

***

## Body Parameters

<ParamField body="identity" type="object">
  Core identity settings.

  <Expandable title="identity fields">
    <ParamField body="system_prompt" type="string">
      The main system prompt that drives the agent's behaviour.
    </ParamField>

    <ParamField body="personality" type="object">
      Key-value map of personality traits (e.g. `{"tone": "friendly"}`).
    </ParamField>

    <ParamField body="greeting_message" type="object">
      Controls the opening message spoken by the agent.

      <Expandable title="greeting_message fields">
        <ParamField body="agent_message" type="string">
          Text the agent says at the start of the call.
        </ParamField>

        <ParamField body="agent_speech_delay" type="integer">
          Delay (seconds, 0–60) before the agent speaks.
        </ParamField>

        <ParamField body="user_speech_delay" type="integer">
          Silence gap (seconds, 0–60) after user stops talking.
        </ParamField>

        <ParamField body="interruptible" type="boolean">
          Whether the greeting can be interrupted by the user.
        </ParamField>

        <ParamField body="let_user_speak_first" type="boolean">
          If `true`, the agent waits for the user to speak before greeting.
        </ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="senses_capabilities" type="object">
  AI provider configuration for speech-to-text, LLM, and text-to-speech.

  <Expandable title="senses_capabilities fields">
    <ParamField body="language" type="string">
      Primary language code (e.g. `"en"`, `"hi"`).
    </ParamField>

    <ParamField body="auto_detect" type="boolean">
      Enable automatic language detection.
    </ParamField>

    <ParamField body="ears" type="object">
      STT (speech-to-text) configuration.

      <Expandable title="ears.stt fields">
        <ParamField body="primary.provider" type="string">STT provider name.</ParamField>
        <ParamField body="primary.model" type="string">STT model identifier.</ParamField>
        <ParamField body="primary.language" type="string">Language hint for STT.</ParamField>
        <ParamField body="primary.keywords" type="array">Keywords to boost recognition accuracy.</ParamField>
        <ParamField body="fallback" type="object">Fallback STT provider (same shape as `primary`).</ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="brain" type="object">
      LLM configuration.

      <Expandable title="brain.llm fields">
        <ParamField body="primary.provider" type="string">LLM provider name (e.g. `"openai"`).</ParamField>
        <ParamField body="primary.model" type="string">Model identifier (e.g. `"gpt-4o"`).</ParamField>
        <ParamField body="primary.parameters.temperature" type="number">Sampling temperature (0–1).</ParamField>
        <ParamField body="primary.parameters.top_p" type="number">Top-p sampling (0–1).</ParamField>
        <ParamField body="primary.parameters.max_tokens" type="integer">Max tokens (50–10000).</ParamField>
        <ParamField body="auto_detect_llm" type="boolean">Auto-select the best LLM for the detected language.</ParamField>
        <ParamField body="fallback" type="object">Fallback LLM provider (same shape as `primary`).</ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="mouth" type="object">
      TTS (text-to-speech) configuration.

      <Expandable title="mouth.tts fields">
        <ParamField body="primary.provider" type="string">TTS provider name (e.g. `"elevenlabs"`).</ParamField>
        <ParamField body="primary.model" type="string">TTS model identifier.</ParamField>
        <ParamField body="primary.voice_id" type="string">Voice ID.</ParamField>
        <ParamField body="primary.voice_name" type="string">Voice name.</ParamField>
        <ParamField body="primary.config" type="object">Provider-specific config key-value pairs.</ParamField>
        <ParamField body="word_pronunciation_pairs" type="object">Map of words to their preferred pronunciation.</ParamField>
        <ParamField body="fallback" type="object">Fallback TTS provider (same shape as `primary`).</ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="actions" type="object">
  Custom actions the agent can take during a call (provider-specific shape).
</ParamField>

<ParamField body="memories" type="object">
  Memory configuration for the agent (provider-specific shape).
</ParamField>

<ParamField body="metadata" type="object">
  Arbitrary metadata key-value pairs attached to the persona.
</ParamField>

***

## Request Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://api.vaanivoice.ai/api/agent/7ec4155e-0e62-440a-b983-5974f7697854/persona \
    -H "X-API-Key: vaani_<your_key>" \
    -H "Content-Type: application/json" \
    -d '{
      "identity": {
        "system_prompt": "You are a helpful customer service agent.",
        "greeting_message": {
          "agent_message": "Hi! How can I help you today?",
          "agent_speech_delay": 1,
          "interruptible": true
        }
      },
      "senses_capabilities": {
        "language": "en",
        "brain": {
          "llm": {
            "primary": {
              "provider": "openai",
              "model": "gpt-4o",
              "parameters": { "temperature": 0.7 }
            }
          }
        }
      }
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.vaanivoice.ai/api/agent/7ec4155e-0e62-440a-b983-5974f7697854/persona",
    {
      method: "PATCH",
      headers: {
        "X-API-Key": "vaani_<your_key>",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        identity: {
          system_prompt: "You are a helpful customer service agent.",
          greeting_message: {
            agent_message: "Hi! How can I help you today?",
            agent_speech_delay: 1,
            interruptible: true,
          },
        },
      }),
    }
  );
  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  requests.patch(
      "https://api.vaanivoice.ai/api/agent/7ec4155e-0e62-440a-b983-5974f7697854/persona",
      headers={"X-API-Key": "vaani_<your_key>", "Content-Type": "application/json"},
      json={
          "identity": {
              "system_prompt": "You are a helpful customer service agent.",
              "greeting_message": {
                  "agent_message": "Hi! How can I help you today?",
                  "agent_speech_delay": 1,
                  "interruptible": True,
              },
          }
      },
  )
  ```
</RequestExample>

***

## Response

<ResponseExample>
  ```json Success (200) theme={null}
  {
    "success": true,
    "message": "Persona section updated successfully"
  }
  ```
</ResponseExample>
