> For a complete page index, fetch https://docs.synthflow.ai/llms.txt. For full documentation content, fetch https://docs.synthflow.ai/llms-full.txt.

# Export analytics data

GET https://api.synthflow.ai/v2/analytics/

Export analytics programmatically for blending with your BI dashboards or internal reporting tools.
### Troubleshooting
* If you are not seeing data for a specific agent, double-check the model_id you are using. Make sure the agent is active.
* Date range errors: limit the query to a maximum of 120 days.
* Unauthorized API access: double-check your API key.

Reference: https://docs.synthflow.ai/api-reference/platform-api/analytics/analytics-export

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://api.synthflow.ai/v2` (Global, default)
- `https://api.us.synthflow.ai/v2` (United States)
- `https://api.eu.synthflow.ai/v2` (European Union)

## Request

### Query parameters

- `from_date` (datetime, optional) — The start date and time for the date range for which you want to export analytics data. If you don't specify the date range, it'll default to the past 7 days. The maximum date range is 120 days. Example: 2025-11-25T14:30:00Z
- `to_date` (datetime, optional) — The end date and time for the date range for which you want to export analytics data. Example: 2025-11-25T14:30:00Z
- `model_id` (string, optional) — If you want to export data for a specific agent, use its model ID. You can find it on the agent's page in your dashboard.
- `type_of_call` (enum, optional) — Filter calls by agent type (`inbound`, `outbound` or `widget`).
  - Allowed values: `inbound`, `outbound`, `widget`

## Response

### 200

200

- `executed_actions` (AnalyticsGetResponsesContentApplicationJsonSchemaExecutedActions, optional) — List of actions executed during the call, as well as their success and frequency rates.
- `assistant_performance` (AnalyticsGetResponsesContentApplicationJsonSchemaAssistantPerformance, optional) — Agent performance overview.
- `call_status_stat` (AnalyticsGetResponsesContentApplicationJsonSchemaCallStatusStat, optional) — Call status overview.
- `recent_call_history` (AnalyticsGetResponsesContentApplicationJsonSchemaRecentCallHistory, optional) — Log of all recent calls.
- `duration_metrics` (AnalyticsGetResponsesContentApplicationJsonSchemaDurationMetrics, optional) — Duration metrics overview.
- `end_call_reason_stat` (AnalyticsGetResponsesContentApplicationJsonSchemaEndCallReasonStat, optional) — An overview of reasons calls ended. For details on all the possible reasons, see [End Call Reasons](/end-call-reasons).
- `sentiment_stat` (AnalyticsGetResponsesContentApplicationJsonSchemaSentimentStat, optional) — Sentiment overview.

## Types

### AnalyticsGetResponsesContentApplicationJsonSchemaExecutedActions

List of actions executed during the call, as well as their success and frequency rates.

- `items` (list of AnalyticsGetResponsesContentApplicationJsonSchemaExecutedActionsItemsItems, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaAssistantPerformance

Agent performance overview.

- `by_minutes_used` (list of AnalyticsGetResponsesContentApplicationJsonSchemaAssistantPerformanceByMinutesUsedItems, optional)
- `by_calls_made` (list of AnalyticsGetResponsesContentApplicationJsonSchemaAssistantPerformanceByCallsMadeItems, optional)
- `by_success_rate` (list of AnalyticsGetResponsesContentApplicationJsonSchemaAssistantPerformanceBySuccessRateItems, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaCallStatusStat

Call status overview.

- `items` (list of AnalyticsGetResponsesContentApplicationJsonSchemaCallStatusStatItemsItems, optional)
- `series` (list of AnalyticsGetResponsesContentApplicationJsonSchemaCallStatusStatSeriesItems, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaRecentCallHistory

Log of all recent calls.

- `items` (list of AnalyticsGetResponsesContentApplicationJsonSchemaRecentCallHistoryItemsItems, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaDurationMetrics

Duration metrics overview.

- `total_minutes` (integer, optional)
- `average_duration` (integer, optional)
- `total_calls` (integer, optional)
- `series` (list of AnalyticsGetResponsesContentApplicationJsonSchemaDurationMetricsSeriesItems, optional)
- `total_minutes_percentage_change` (integer, optional)
- `total_duration_percentage_change` (integer, optional)
- `total_calls_percentage_change` (integer, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaEndCallReasonStat

An overview of reasons calls ended. For details on all the possible reasons, see [End Call Reasons](/end-call-reasons).

- `items` (list of AnalyticsGetResponsesContentApplicationJsonSchemaEndCallReasonStatItemsItems, optional)
- `series` (list of AnalyticsGetResponsesContentApplicationJsonSchemaEndCallReasonStatSeriesItems, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaSentimentStat

Sentiment overview.

- `positive_percentage` (integer, optional)
- `series` (list of AnalyticsGetResponsesContentApplicationJsonSchemaSentimentStatSeriesItems, optional)
- `positive_percentage_change` (integer, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaExecutedActionsItemsItems

- `name` (string, optional) — Action name.
- `value` (integer, optional)
- `series` (list of AnalyticsGetResponsesContentApplicationJsonSchemaExecutedActionsItemsItemsSeriesItems, optional)
- `percentage_change` (integer, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaAssistantPerformanceByMinutesUsedItems

- `model_id` (string, optional)
- `name` (string, optional)
- `minutes_used` (integer, optional)
- `percentage_change` (integer, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaAssistantPerformanceByCallsMadeItems

- `model_id` (string, optional)
- `name` (string, optional)
- `calls_made` (integer, optional)
- `percent_change` (integer, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaAssistantPerformanceBySuccessRateItems

- `model_id` (string, optional)
- `name` (string, optional)
- `success_rate` (integer, optional)
- `percentage_change` (integer, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaCallStatusStatItemsItems

- `status` (string, optional)
- `value` (integer, optional)
- `percentage` (integer, optional)
- `percentage_change` (integer, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaCallStatusStatSeriesItems

- `date` (string, optional)
- `completed` (integer, optional)
- `hangup_on_voicemail` (integer, optional)
- `busy` (integer, optional)
- `no-answer` (integer, optional)
- `failed` (integer, optional)
- `left_voicemail` (integer, optional)
- `in-progress` (integer, optional)
- `checking` (integer, optional)
- `paused` (integer, optional)
- `queue` (integer, optional)
- `initiated` (integer, optional)
- `ringing` (integer, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaRecentCallHistoryItemsItems

- `call_id` (string, optional)
- `call_status` (string, optional)
- `duration` (integer, optional)
- `agent_name` (string, optional)
- `model_id` (string, optional)
- `lead_phone_number` (string, optional)
- `created_at` (string, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaDurationMetricsSeriesItems

- `date` (string, optional)
- `total_minutes` (integer, optional)
- `average_duration` (integer, optional)
- `total_calls` (integer, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaEndCallReasonStatItemsItems

- `reason` (string, optional)
- `value` (integer, optional)
- `percentage` (integer, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaEndCallReasonStatSeriesItems

- `date` (string, optional)
- `voicemail` (integer, optional)
- `human_goodbye` (integer, optional)
- `agent_goodbye` (integer, optional)
- `human_pick_up_cut_off` (integer, optional)
- `max_duration` (integer, optional)
- `idle_time_exceeded` (integer, optional)
- `goodbye_detected` (integer, optional)
- `user_disconnected` (integer, optional)
- `voicemail_message_left` (integer, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaSentimentStatSeriesItems

- `date` (string, optional)
- `positive` (integer, optional)
- `total` (integer, optional)

### AnalyticsGetResponsesContentApplicationJsonSchemaExecutedActionsItemsItemsSeriesItems

- `date` (string, optional)
- `value` (integer, optional)

## Examples

**Response**

```json
{
  "executed_actions": {
    "items": [
      {
        "name": "extract_info_action_type",
        "value": 1200,
        "series": [
          {
            "items": {
              "properties": {
                "date": {},
                "value": 1200
              },
              "type": "object"
            }
          }
        ]
      },
      {
        "name": "new_custom_action",
        "value": 24,
        "series": [
          {
            "items": {
              "properties": {
                "date": {},
                "value": 24
              },
              "type": "object"
            }
          }
        ]
      }
    ]
  },
  "assistant_performance": {
    "by_minutes_used": [
      {
        "model_id": "b2fe4436-760b-484e-a2d6-9daa0bdfdbea",
        "name": "Jake",
        "minutes_used": 198.4,
        "percentage_change": 100
      }
    ],
    "by_calls_made": [
      {
        "model_id": "b2fe4436-760b-484e-a2d6-9daa0bdfdbea",
        "name": "Jake",
        "calls_made": 264,
        "percent_change": 100
      }
    ],
    "by_success_rate": [
      {
        "model_id": "b2fe4436-760b-484e-a2d6-9daa0bdfdbea",
        "name": "Jake",
        "success_rate": 81.81818,
        "percentage_change": 100
      }
    ]
  },
  "call_status_stat": {
    "items": [
      {
        "status": "completed",
        "value": 240,
        "percentage": 90.91,
        "percentage_change": 100
      },
      {
        "status": "failed",
        "value": 24,
        "percentage": 90.91,
        "percentage_change": 100
      }
    ],
    "series": [
      {
        "date": "2025-07-2025",
        "completed": 240,
        "hangup_on_voicemail": 0,
        "busy": 0,
        "no-answer": 0,
        "failed": 0,
        "left_voicemail": 0,
        "in-progress": 0,
        "checking": 0,
        "paused": 0,
        "queue": 0,
        "initiated": 0,
        "ringing": 0
      }
    ]
  },
  "recent_call_history": {
    "items": [
      {
        "call_id": "test",
        "call_status": "completed",
        "duration": 38,
        "agent_name": "Jake",
        "model_id": "b2fe4436-760b-484e-a2d6-9daa0bdfdbea",
        "lead_phone_number": "+4915758658647",
        "created_at": {}
      }
    ]
  },
  "duration_metrics": {
    "total_minutes": 198.4,
    "average_duration": 0.7515151515151516,
    "total_calls": 264,
    "series": [
      {
        "date": "2025-07-2025",
        "total_minutes": 198.4,
        "average_duration": 0.7515151515151516,
        "total_calls": 264
      }
    ],
    "total_minutes_percentage_change": 100,
    "total_duration_percentage_change": 100,
    "total_calls_percentage_change": 100
  },
  "end_call_reason_stat": {
    "items": [
      {
        "reason": "agent_goodbye",
        "value": 168,
        "percentage": 63.64
      },
      {
        "reason": "human_goodbye",
        "value": 48,
        "percentage": 63.64
      },
      {
        "reason": "human_pick_up_cut_off",
        "value": 24,
        "percentage": 63.64
      },
      {
        "reason": "Request failed: 500, message='Internal Server Error",
        "value": 24,
        "percentage": 63.64
      }
    ],
    "series": [
      {
        "date": {},
        "voicemail": 0,
        "human_goodbye": 48,
        "agent_goodbye": 168,
        "human_pick_up_cut_off": 24,
        "max_duration": 0,
        "idle_time_exceeded": 0,
        "goodbye_detected": 0,
        "user_disconnected": 0,
        "voicemail_message_left": 0
      }
    ]
  },
  "sentiment_stat": {
    "positive_percentage": 90.91,
    "series": [
      {
        "date": {},
        "positive": 240,
        "total": 264
      }
    ],
    "positive_percentage_change": 100
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.synthflow.ai/v2/analytics/"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.synthflow.ai/v2/analytics/"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.synthflow.ai/v2/analytics/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.synthflow.ai/v2/analytics/")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.synthflow.ai/v2/analytics/");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.synthflow.ai/v2/analytics/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```