Get Analytics
Analytics
Get Analytics
Retrieve call analytics and task status for your organization
GET
Get Analytics
Documentation Index
Fetch the complete documentation index at: https://docs.unpod.dev/llms.txt
Use this file to discover all available pages before exploring further.
Get Analytics
Retrieve call analytics and task status for your organization. Provides insights into call outcomes, success rates, average durations, and task execution summaries. Optionally filter by a specific space using thespace_token query parameter.
Prerequisites: Make sure you have your API Token and Org-Handle ready. See Authentication for details.
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | API Key format: Token <token> |
| Org-Handle | string | Yes | Organization domain handle |
You can get the
Org-Handle by hitting the Get All Organizations API. The domain_handle field in the response is your Org-Handle.Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| space_token | string | No | Filter analytics for a specific space. If omitted, returns org-wide analytics |
If
space_token is provided, analytics are scoped to that space only. If not provided, analytics aggregate across all contact spaces in the organization.Response Fields
| Field | Type | Description |
|---|---|---|
| status_code | integer | HTTP status code |
| message | string | Response message |
| data | object | Analytics data |
Analytics Data Fields
| Field | Type | Description |
|---|---|---|
| total_calls | integer | Total number of calls made |
| completed_calls | integer | Number of successfully completed calls |
| failed_calls | integer | Number of failed calls |
| avg_duration_seconds | number | Average call duration in seconds |
| total_tasks | integer | Total number of tasks across all runs |
| task_status_breakdown | object | Breakdown of tasks by status |
Task Status Breakdown Fields
| Field | Type | Description |
|---|---|---|
| pending | integer | Number of tasks awaiting execution |
| running | integer | Number of tasks currently executing |
| completed | integer | Number of successfully completed tasks |
| failed | integer | Number of failed tasks |
Common Error Codes
| Status Code | Description |
|---|---|
| 200 | Success - Analytics fetched successfully |
| 400 | Bad Request - Missing required headers |
| 401 | Unauthorized - Invalid or missing API token |
| 403 | Forbidden - Invalid organization handle |
| 404 | Not Found - Organization not found |
| 500 | Internal Server Error - Server-side error |
Code Examples
Best Practices
- Space Scoping: Use the
space_tokenfilter to get analytics for individual campaigns or spaces - Success Rate: Calculate success rate as
completed_calls / total_calls * 100for performance tracking - Task Breakdown: Monitor
task_status_breakdownto detect stuck or failed tasks requiring attention - Scheduled Reports: Call this endpoint on a schedule to build trend dashboards
- Org-Handle: Ensure the correct organization handle is included for accurate scoping
- Security: Keep API tokens secure and rotate them regularly