Skip to main content
PATCH
/
api
/
agent
/
{agent_id}
/
analysis
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
          }
        ]
      }
    }
  }'
{
  "success": true,
  "message": "Analysis section updated successfully"
}

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

agent_id
string
required
UUID of the agent to update.

Body Parameters

evaluations
object
Post-call evaluation configuration.
extraction
object
Structured data extraction from call transcripts.

Request Example

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
          }
        ]
      }
    }
  }'

Response

{
  "success": true,
  "message": "Analysis section updated successfully"
}