Skip to main content
GET
/
v1
/
agent-testing
/
analytics
/
{pathwayId}
/
enhanced
Get Enhanced Analytics
curl --request GET \
  --url https://api.bland.ai/v1/agent-testing/analytics/{pathwayId}/enhanced \
  --header 'authorization: <authorization>'
{
  "total_runs": 124,
  "passed": 98,
  "failed": 26,
  "pass_rate": 0.7903,
  "avg_score": 0.82,
  "health_score": 0.76,
  "reliability_score": 0.85,
  "trend": {
    "weekly": "improving",
    "daily_pass_rates": [
      { "date": "2026-04-12", "rate": 0.75, "count": 8 },
      { "date": "2026-04-13", "rate": 0.88, "count": 16 },
      { "date": "2026-04-14", "rate": 0.90, "count": 10 }
    ]
  },
  "node_failure_heatmap": [
    {
      "node_id": "node_8f3a2b1c",
      "node_name": "Escalation Handler",
      "failure_count": 14,
      "total_traversals": 38,
      "failure_rate": 0.3684
    },
    {
      "node_id": "node_4d7e9f0a",
      "node_name": "Appointment Booking",
      "failure_count": 8,
      "total_traversals": 72,
      "failure_rate": 0.1111
    },
    {
      "node_id": "node_1a2b3c4d",
      "node_name": "Greeting",
      "failure_count": 2,
      "total_traversals": 124,
      "failure_rate": 0.0161
    },
    {
      "node_id": "node_5e6f7a8b",
      "node_name": "Collect Info",
      "failure_count": 2,
      "total_traversals": 110,
      "failure_rate": 0.0182
    }
  ],
  "weakest_link": {
    "node_id": "node_8f3a2b1c",
    "node_name": "Escalation Handler",
    "failure_rate": 0.3684
  },
  "sankey_data": {
    "nodes": [
      { "id": "node_1a2b3c4d", "name": "Greeting", "type": "Default", "category": "start" },
      { "id": "node_5e6f7a8b", "name": "Collect Info", "type": "Default", "category": "middle" },
      { "id": "node_4d7e9f0a", "name": "Appointment Booking", "type": "Default", "category": "middle" },
      { "id": "node_8f3a2b1c", "name": "Escalation Handler", "type": "Transfer", "category": "middle" },
      { "id": "node_9c0d1e2f", "name": "Confirmation", "type": "Default", "category": "middle" },
      { "id": "node_end_001", "name": "End Call", "type": "End Call", "category": "end" }
    ],
    "links": [
      { "source": "node_1a2b3c4d", "target": "node_5e6f7a8b", "value": 110, "pass_count": 96, "fail_count": 14 },
      { "source": "node_5e6f7a8b", "target": "node_4d7e9f0a", "value": 72, "pass_count": 64, "fail_count": 8 },
      { "source": "node_5e6f7a8b", "target": "node_8f3a2b1c", "value": 38, "pass_count": 24, "fail_count": 14 },
      { "source": "node_4d7e9f0a", "target": "node_9c0d1e2f", "value": 64, "pass_count": 64, "fail_count": 0 },
      { "source": "node_9c0d1e2f", "target": "node_end_001", "value": 64, "pass_count": 64, "fail_count": 0 },
      { "source": "node_8f3a2b1c", "target": "node_end_001", "value": 24, "pass_count": 24, "fail_count": 0 }
    ]
  }
}

Headers

authorization
string
required
Your API key for authentication.

Path Parameters

pathwayId
string
required
The pathway ID.

Query Parameters

days
integer
default:"30"
Number of days to look back. Maximum value is 365.

Response

total_runs
integer
Total number of test runs in the time window.
passed
integer
Number of test runs that passed.
failed
integer
Number of test runs that failed.
pass_rate
number
Pass rate as a decimal from 0 to 1.
avg_score
number
Average score across all runs, from 0 to 1.
health_score
number
Overall health score for the pathway, from 0 to 1. Combines pass rate, trend direction, and reliability.
reliability_score
number
Reliability score measuring consistency of results over time, from 0 to 1.
trend
object
Trend analysis for the time window.
node_failure_heatmap
array
Failure data per node for building a heatmap visualization.
The node with the highest failure rate, or null if no failures exist.
sankey_data
object
Flow data for building a Sankey diagram of test run traversals.
{
  "total_runs": 124,
  "passed": 98,
  "failed": 26,
  "pass_rate": 0.7903,
  "avg_score": 0.82,
  "health_score": 0.76,
  "reliability_score": 0.85,
  "trend": {
    "weekly": "improving",
    "daily_pass_rates": [
      { "date": "2026-04-12", "rate": 0.75, "count": 8 },
      { "date": "2026-04-13", "rate": 0.88, "count": 16 },
      { "date": "2026-04-14", "rate": 0.90, "count": 10 }
    ]
  },
  "node_failure_heatmap": [
    {
      "node_id": "node_8f3a2b1c",
      "node_name": "Escalation Handler",
      "failure_count": 14,
      "total_traversals": 38,
      "failure_rate": 0.3684
    },
    {
      "node_id": "node_4d7e9f0a",
      "node_name": "Appointment Booking",
      "failure_count": 8,
      "total_traversals": 72,
      "failure_rate": 0.1111
    },
    {
      "node_id": "node_1a2b3c4d",
      "node_name": "Greeting",
      "failure_count": 2,
      "total_traversals": 124,
      "failure_rate": 0.0161
    },
    {
      "node_id": "node_5e6f7a8b",
      "node_name": "Collect Info",
      "failure_count": 2,
      "total_traversals": 110,
      "failure_rate": 0.0182
    }
  ],
  "weakest_link": {
    "node_id": "node_8f3a2b1c",
    "node_name": "Escalation Handler",
    "failure_rate": 0.3684
  },
  "sankey_data": {
    "nodes": [
      { "id": "node_1a2b3c4d", "name": "Greeting", "type": "Default", "category": "start" },
      { "id": "node_5e6f7a8b", "name": "Collect Info", "type": "Default", "category": "middle" },
      { "id": "node_4d7e9f0a", "name": "Appointment Booking", "type": "Default", "category": "middle" },
      { "id": "node_8f3a2b1c", "name": "Escalation Handler", "type": "Transfer", "category": "middle" },
      { "id": "node_9c0d1e2f", "name": "Confirmation", "type": "Default", "category": "middle" },
      { "id": "node_end_001", "name": "End Call", "type": "End Call", "category": "end" }
    ],
    "links": [
      { "source": "node_1a2b3c4d", "target": "node_5e6f7a8b", "value": 110, "pass_count": 96, "fail_count": 14 },
      { "source": "node_5e6f7a8b", "target": "node_4d7e9f0a", "value": 72, "pass_count": 64, "fail_count": 8 },
      { "source": "node_5e6f7a8b", "target": "node_8f3a2b1c", "value": 38, "pass_count": 24, "fail_count": 14 },
      { "source": "node_4d7e9f0a", "target": "node_9c0d1e2f", "value": 64, "pass_count": 64, "fail_count": 0 },
      { "source": "node_9c0d1e2f", "target": "node_end_001", "value": 64, "pass_count": 64, "fail_count": 0 },
      { "source": "node_8f3a2b1c", "target": "node_end_001", "value": 24, "pass_count": 24, "fail_count": 0 }
    ]
  }
}