> ## 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 Analysis

> Partially update the analysis section of an agent

## Update Agent Analysis

Partially update the **analysis** section of an agent. Only the fields you include are merged into the existing config; omitted fields remain unchanged.

The analysis section controls post-call **evaluations** (dispositions, conversation scoring) and **extraction** (structured data collection, concern tracking).

***

## Path Parameters

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

***

## Body Parameters

<ParamField body="evaluations" type="object">
  Post-call evaluation configuration.

  <Expandable title="evaluations fields">
    <ParamField body="dispositions" type="object">
      Call disposition tagging.

      <Expandable title="dispositions fields">
        <ParamField body="enabled" type="boolean">Enable disposition tagging.</ParamField>

        <ParamField body="prompt_based" type="array">
          List of prompt-driven disposition items. Each item has:

          <Expandable title="disposition item fields">
            <ParamField body="name" type="string" required>
              Disposition name (max 30 chars, e.g. `"purchase_intent"`).
            </ParamField>

            <ParamField body="type" type="string" required>
              Value type: `"bool"` | `"string"` | `"number"`.
            </ParamField>

            <ParamField body="prompt" type="string" required>
              Prompt instruction for the LLM to evaluate this disposition.
            </ParamField>

            <ParamField body="list_of_tags" type="object">
              Optional tag-to-description map (e.g. `{"Yes": "user showed interest", "No": "no interest"}`).
            </ParamField>
          </Expandable>
        </ParamField>

        <ParamField body="system_based" type="array">
          System-defined dispositions (provider-specific shape).
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="conversation_evaluation" type="object">
      Overall conversation quality evaluation.

      <Expandable title="conversation_evaluation fields">
        <ParamField body="enabled" type="boolean">Enable conversation evaluation.</ParamField>
        <ParamField body="prompt" type="string">Custom evaluation prompt for the LLM.</ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="extraction" type="object">
  Structured data extraction from call transcripts.

  <Expandable title="extraction fields">
    <ParamField body="data_collection" type="object">
      Extract specific data points from each call.

      <Expandable title="data_collection fields">
        <ParamField body="enabled" type="boolean">Enable data extraction.</ParamField>

        <ParamField body="data_points" type="array">
          List of data-point definitions. Each item has:

          <Expandable title="data point fields">
            <ParamField body="name" type="string" required>
              Data point name (max 30 chars, e.g. `"customer_email"`).
            </ParamField>

            <ParamField body="prompt" type="string" required>
              Instruction for the LLM to extract this value from the transcript.
            </ParamField>

            <ParamField body="values" type="array">
              Optional list of allowed values (enum-style extraction).
            </ParamField>

            <ParamField body="nullable" type="boolean">
              Whether the field may be `null` if not found.
            </ParamField>
          </Expandable>
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="collect_concerns" type="object">
      Capture unresolved issues or complaints raised during the call.

      <Expandable title="collect_concerns fields">
        <ParamField body="enabled" type="boolean">Enable concern collection.</ParamField>
        <ParamField body="prompt" type="string">Custom prompt for concern detection.</ParamField>
      </Expandable>
    </ParamField>
  </Expandable>
</ParamField>

***

## Request Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH https://api.vaanivoice.ai/api/agent/7ec4155e-0e62-440a-b983-5974f7697854/analysis \
    -H "X-API-Key: vaani_<your_key>" \
    -H "Content-Type: application/json" \
    -d '{
      "evaluations": {
        "dispositions": {
          "enabled": true,
          "prompt_based": [
            {
              "name": "purchase_intent",
              "type": "bool",
              "prompt": "Did the user express interest in purchasing?",
              "list_of_tags": {"Yes": "user showed clear buying intent", "No": "no purchase intent detected"}
            }
          ]
        },
        "conversation_evaluation": {
          "enabled": true,
          "prompt": "Rate the quality of this customer service call on a scale of 1-10 and explain why."
        }
      },
      "extraction": {
        "data_collection": {
          "enabled": true,
          "data_points": [
            {
              "name": "customer_name",
              "prompt": "Extract the customer name from the transcript.",
              "nullable": true
            }
          ]
        }
      }
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    "https://api.vaanivoice.ai/api/agent/7ec4155e-0e62-440a-b983-5974f7697854/analysis",
    {
      method: "PATCH",
      headers: {
        "X-API-Key": "vaani_<your_key>",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        evaluations: {
          dispositions: {
            enabled: true,
            prompt_based: [
              {
                name: "purchase_intent",
                type: "bool",
                prompt: "Did the user express interest in purchasing?",
              },
            ],
          },
        },
      }),
    }
  );
  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/analysis",
      headers={"X-API-Key": "vaani_<your_key>", "Content-Type": "application/json"},
      json={
          "extraction": {
              "data_collection": {
                  "enabled": True,
                  "data_points": [
                      {
                          "name": "callback_requested",
                          "prompt": "Did the customer ask for a callback?",
                          "nullable": False,
                      }
                  ],
              },
              "collect_concerns": {"enabled": True},
          }
      },
  )
  ```
</RequestExample>

***

## Response

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