Agent
Get Tasks by Agent Handle
Retrieve all tasks assigned to a specific agent using its handle
GET
/
api
/
v2
/
platform
/
agents
/
{agent_handle}
/
tasks
/
Get Tasks by Agent Handle
curl --request GET \
--url https://unpod.ai/api/v2/platform/agents/{agent_handle}/tasks/ \
--header 'Authorization: <api-key>' \
--header 'Org-Handle: <org-handle>'import requests
url = "https://unpod.ai/api/v2/platform/agents/{agent_handle}/tasks/"
headers = {
"Org-Handle": "<org-handle>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Org-Handle': '<org-handle>', Authorization: '<api-key>'}
};
fetch('https://unpod.ai/api/v2/platform/agents/{agent_handle}/tasks/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://unpod.ai/api/v2/platform/agents/{agent_handle}/tasks/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Org-Handle: <org-handle>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://unpod.ai/api/v2/platform/agents/{agent_handle}/tasks/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Org-Handle", "<org-handle>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://unpod.ai/api/v2/platform/agents/{agent_handle}/tasks/")
.header("Org-Handle", "<org-handle>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://unpod.ai/api/v2/platform/agents/{agent_handle}/tasks/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Org-Handle"] = '<org-handle>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"count": 1,
"status_code": 200,
"message": "Tasks Fetched Successfully",
"data": [
{
"_id": "697debb84c27faa892bfa0cd",
"space_id": "42",
"thread_id": "",
"user": "",
"user_org_id": "101",
"user_info": {},
"created": "2026-02-07T05:51:51.607000",
"modified": "2026-02-07T06:06:30.000000",
"task_id": "T1a2b3c4dfe9a11f0878d43cd8a99e069",
"run_id": "R1a2b3c4cfe9a11f0878d43cd8a99e069",
"collection_ref": "collection_data_SPTKN4XQ7M2VB9YH3KD8WZ1L",
"task": {},
"input": {
"contact_number": "+911234567890",
"quality": "good",
"name": "Jane Doe",
"token": "SPTKN4XQ7M2VB9YH3KD8WZ1L",
"space_token": "SPTKN4XQ7M2VB9YH3KD8WZ1L",
"org_id": 101,
"missing_space_context": false
},
"output": {
"call_id": "Unpod Bridge_1234567890_AbCdEfGhIjKl",
"customer": "Jane Doe",
"contact_number": "+911234567890",
"call_type": "inbound",
"call_status": "connected",
"call_end_reason": "USER_HUNG_UP_IN_CALL",
"transcript": [
{
"role": "assistant",
"content": "Hello, main Sunrise Heights se bol rahi hoon. Kya abhi baat karne ka sahi samay hai?",
"timestamp": "2026-02-07 05:58:00.000000",
"participant": "agent",
"start_time": "2026-02-07T05:57:55.000000",
"end_time": "2026-02-07T05:58:00.000000",
"language": "hi"
},
{
"role": "user",
"content": "Haan, boliye.",
"timestamp": "2026-02-07 05:58:05.000000",
"participant": "sip_1234567890",
"start_time": "2026-02-07T05:58:03.000000",
"end_time": "2026-02-07T05:58:05.000000",
"language": "hi"
},
{
"role": "assistant",
"content": "Thank you! Yeh call aapke Sunrise Heights me dikhaye gaye interest ke regarding hai. Kya main continue karoon?",
"timestamp": "2026-02-07 05:58:15.000000",
"participant": "agent",
"start_time": "2026-02-07T05:58:08.000000",
"end_time": "2026-02-07T05:58:15.000000",
"language": "hi"
},
{
"role": "user",
"content": "Haan, main 2 BHK ke baare me dekh rahi thi.",
"timestamp": "2026-02-07 05:58:22.000000",
"participant": "sip_1234567890",
"start_time": "2026-02-07T05:58:19.000000",
"end_time": "2026-02-07T05:58:22.000000",
"language": "hi"
},
{
"role": "assistant",
"content": "Bilkul. Hamare paas spacious 2 BHK residences hain, zero-wastage layouts ke saath. Kya main aapki site visit schedule kar doon?",
"timestamp": "2026-02-07 05:58:40.000000",
"participant": "agent",
"start_time": "2026-02-07T05:58:25.000000",
"end_time": "2026-02-07T05:58:40.000000",
"language": "hi"
},
{
"role": "user",
"content": "Haan, kal 11 baje ke liye schedule kar dijiye.",
"timestamp": "2026-02-07 05:58:48.000000",
"participant": "sip_1234567890",
"start_time": "2026-02-07T05:58:45.000000",
"end_time": "2026-02-07T05:58:48.000000",
"language": "hi"
},
{
"role": "assistant",
"content": "Perfect. Maine aapki visit kal 11 AM ke liye schedule kar di hai. Hamare sales expert aapko assist karenge. Dhanyavaad!",
"timestamp": "2026-02-07 05:59:05.000000",
"participant": "agent",
"start_time": "2026-02-07T05:58:52.000000",
"end_time": "2026-02-07T05:59:05.000000",
"language": "hi"
}
],
"recording_url": "https://cdn.unpod.ai/recordings/CALL_AbCdEfGhIjKl.mp3",
"files": [],
"start_time": "2026-02-07T05:57:45",
"end_time": "2026-02-07T06:06:25",
"call_timings": {
"call_dialed_at": "2026-02-07T05:57:44",
"call_connected_at": "2026-02-07T05:57:45",
"call_ended_at": "2026-02-07T06:06:25",
"ring_duration": 1,
"talk_duration": 520
},
"duration": 520,
"provider_call_id": "AbCdEfGhIjKlMnOpQrStUv@unpod.ai",
"assistant_number": "+919876543210",
"metadata": {
"cost": 0.600075,
"type": "",
"usage": {
"llm_provider": "Unpod",
"llm_model": "google/gemma-4-31b-it",
"tts_provider": "elevenlabs",
"tts_model": "eleven_v3",
"stt_provider": "soniox",
"stt_model": "stt-rt-v5",
"llm_prompt_tokens": 1199715,
"llm_completion_tokens": 1112,
"tts_characters_count": 4635,
"stt_audio_duration": 508.2,
"costs": {
"llm_cost": 0,
"stt_cost": 0.018,
"tts_cost": 0.4635
},
"total_cost": 0.5715
},
"provider": "livekit",
"room_name": "Unpod Bridge_1234567890_AbCdEfGhIjKl"
},
"post_call_data": {
"schema_version": 2,
"analytics": {
"sentiment": "positive",
"engagement": "high",
"tone": "friendly",
"contact_status": "active",
"call_score": 70,
"call_score_breakdown": {
"components": {
"interest_intent": 20,
"use_case_relevance": 10,
"timeline_urgency": 10,
"authority_influence": 10,
"engagement_quality": 10,
"next_step_commitment": 10
},
"total": 70,
"reason": "The user was actively engaged, showed strong interest in the offering, and agreed to a site visit."
}
},
"summary": {
"headline": "Site visit scheduled for tomorrow at 11 AM to explore the 2 BHK configuration.",
"key_points": [
"Customer showed interest in a 2 BHK residence.",
"Agent provided details about the residential project and its features.",
"Customer scheduled a site visit for tomorrow at 11:00 AM.",
"Agent confirmed the visit details and assured assistance during the visit."
]
},
"lead": {
"name": "Jane Doe",
"labels": [
"Interested"
],
"objections": [],
"pain_points": [],
"questions_asked": [
"What kind of space are you picturing for your family?",
"Can you repeat that once?",
"What are the available configurations?"
]
},
"structured_data": {
"status": "Qualified",
"outcome": "Call Disconnected",
"lead_intent": "High",
"end_call_reason": "Call Disconnected"
},
"next_action": {
"label": [
"Agent to schedule site visit for tomorrow at 11 AM",
"Agent to send visit details via WhatsApp and SMS"
],
"callback_requested": false,
"scheduled_at": null
},
"follow_up": {
"required": false,
"state": "skipped_inbound_call",
"reason": "Outcome falls under stop list conditions. No follow-up required.",
"next_at": null,
"attempt": 1,
"attempts_remaining": 1,
"policy": {
"max_call_attempts": 2,
"max_followup_attempts": 1,
"daily_limit": 3,
"next_call_attempt_number": null
}
},
"success_evaluation": {
"status": "completed",
"reason": "",
"result": 8
},
"call_evaluation": null,
"redial": {
"status": null
},
"skipped": [
{
"stage": "call_evaluation",
"reason": "policy:disabled_in_config"
},
{
"stage": "realtime_agent_evaluation",
"reason": "policy:disabled_in_config"
},
{
"stage": "spam_detection",
"reason": "policy:disabled_in_config"
}
]
},
"call_traces": [
{
"status": "callRequested",
"timestamp": "2026-02-07T05:57:44.000000",
"previous_status": "",
"message": "call status set: callRequested",
"event": "status_change",
"end_reason": "",
"error_message": ""
},
{
"status": "ringing",
"timestamp": "2026-02-07T05:57:45.000000",
"previous_status": "callRequested",
"message": "call status changed: callRequested -> ringing",
"event": "status_change",
"end_reason": "",
"error_message": ""
},
{
"status": "active",
"timestamp": "2026-02-07T05:57:46.000000",
"previous_status": "ringing",
"message": "call status changed: ringing -> active",
"event": "status_change",
"end_reason": "",
"error_message": ""
},
{
"status": "hungUp",
"timestamp": "2026-02-07T06:06:24.000000",
"previous_status": "active",
"message": "call status changed: active -> hungUp | reason: USER_HUNG_UP_IN_CALL",
"event": "status_change",
"end_reason": "USER_HUNG_UP_IN_CALL",
"error_message": ""
},
{
"status": "connected",
"timestamp": "2026-02-07T06:06:29.000000",
"previous_status": "callEnded",
"message": "call finalized: connected",
"event": "finalized",
"end_reason": "USER_HUNG_UP_IN_CALL",
"error_message": ""
}
],
"error": "",
"error_code": "",
"end_reason": "User"
},
"attachments": [],
"assignee": "space-agent-8qmk42nslp91wrh3dz7btxc4",
"status": "completed",
"execution_type": "call",
"ref_id": "6902fb5840a736e125e80ebc",
"failure_count": 0,
"last_failure_reason": null,
"provider": null,
"retry_attempt": 0,
"referenced_task": null,
"follow_up_count": null,
"follow_up_chain_id": null,
"last_status_change": "2026-02-07T05:51:51.606885",
"scheduled_timestamp": null
}
]
}
{
"message": "Agent not found"
}
{
"count": 1,
"status_code": 200,
"message": "Tasks Fetched Successfully",
"data": [
{
"_id": "697debb84c27faa892bfa0cd",
"space_id": "42",
"thread_id": "",
"user": "",
"user_org_id": "101",
"user_info": {},
"created": "2026-02-07T05:51:51.607000",
"modified": "2026-02-07T06:06:30.000000",
"task_id": "T1a2b3c4dfe9a11f0878d43cd8a99e069",
"run_id": "R1a2b3c4cfe9a11f0878d43cd8a99e069",
"collection_ref": "collection_data_SPTKN4XQ7M2VB9YH3KD8WZ1L",
"task": {},
"input": {
"contact_number": "+911234567890",
"quality": "good",
"name": "Jane Doe",
"token": "SPTKN4XQ7M2VB9YH3KD8WZ1L",
"space_token": "SPTKN4XQ7M2VB9YH3KD8WZ1L",
"org_id": 101,
"missing_space_context": false
},
"output": {
"call_id": "Unpod Bridge_1234567890_AbCdEfGhIjKl",
"customer": "Jane Doe",
"contact_number": "+911234567890",
"call_type": "inbound",
"call_status": "connected",
"call_end_reason": "USER_HUNG_UP_IN_CALL",
"transcript": [
{
"role": "assistant",
"content": "Hello, main Sunrise Heights se bol rahi hoon. Kya abhi baat karne ka sahi samay hai?",
"timestamp": "2026-02-07 05:58:00.000000",
"participant": "agent",
"start_time": "2026-02-07T05:57:55.000000",
"end_time": "2026-02-07T05:58:00.000000",
"language": "hi"
},
{
"role": "user",
"content": "Haan, boliye.",
"timestamp": "2026-02-07 05:58:05.000000",
"participant": "sip_1234567890",
"start_time": "2026-02-07T05:58:03.000000",
"end_time": "2026-02-07T05:58:05.000000",
"language": "hi"
},
{
"role": "assistant",
"content": "Thank you! Yeh call aapke Sunrise Heights me dikhaye gaye interest ke regarding hai. Kya main continue karoon?",
"timestamp": "2026-02-07 05:58:15.000000",
"participant": "agent",
"start_time": "2026-02-07T05:58:08.000000",
"end_time": "2026-02-07T05:58:15.000000",
"language": "hi"
},
{
"role": "user",
"content": "Haan, main 2 BHK ke baare me dekh rahi thi.",
"timestamp": "2026-02-07 05:58:22.000000",
"participant": "sip_1234567890",
"start_time": "2026-02-07T05:58:19.000000",
"end_time": "2026-02-07T05:58:22.000000",
"language": "hi"
},
{
"role": "assistant",
"content": "Bilkul. Hamare paas spacious 2 BHK residences hain, zero-wastage layouts ke saath. Kya main aapki site visit schedule kar doon?",
"timestamp": "2026-02-07 05:58:40.000000",
"participant": "agent",
"start_time": "2026-02-07T05:58:25.000000",
"end_time": "2026-02-07T05:58:40.000000",
"language": "hi"
},
{
"role": "user",
"content": "Haan, kal 11 baje ke liye schedule kar dijiye.",
"timestamp": "2026-02-07 05:58:48.000000",
"participant": "sip_1234567890",
"start_time": "2026-02-07T05:58:45.000000",
"end_time": "2026-02-07T05:58:48.000000",
"language": "hi"
},
{
"role": "assistant",
"content": "Perfect. Maine aapki visit kal 11 AM ke liye schedule kar di hai. Hamare sales expert aapko assist karenge. Dhanyavaad!",
"timestamp": "2026-02-07 05:59:05.000000",
"participant": "agent",
"start_time": "2026-02-07T05:58:52.000000",
"end_time": "2026-02-07T05:59:05.000000",
"language": "hi"
}
],
"recording_url": "https://cdn.unpod.ai/recordings/CALL_AbCdEfGhIjKl.mp3",
"files": [],
"start_time": "2026-02-07T05:57:45",
"end_time": "2026-02-07T06:06:25",
"call_timings": {
"call_dialed_at": "2026-02-07T05:57:44",
"call_connected_at": "2026-02-07T05:57:45",
"call_ended_at": "2026-02-07T06:06:25",
"ring_duration": 1,
"talk_duration": 520
},
"duration": 520,
"provider_call_id": "AbCdEfGhIjKlMnOpQrStUv@unpod.ai",
"assistant_number": "+919876543210",
"metadata": {
"cost": 0.600075,
"type": "",
"usage": {
"llm_provider": "Unpod",
"llm_model": "google/gemma-4-31b-it",
"tts_provider": "elevenlabs",
"tts_model": "eleven_v3",
"stt_provider": "soniox",
"stt_model": "stt-rt-v5",
"llm_prompt_tokens": 1199715,
"llm_completion_tokens": 1112,
"tts_characters_count": 4635,
"stt_audio_duration": 508.2,
"costs": {
"llm_cost": 0,
"stt_cost": 0.018,
"tts_cost": 0.4635
},
"total_cost": 0.5715
},
"provider": "livekit",
"room_name": "Unpod Bridge_1234567890_AbCdEfGhIjKl"
},
"post_call_data": {
"schema_version": 2,
"analytics": {
"sentiment": "positive",
"engagement": "high",
"tone": "friendly",
"contact_status": "active",
"call_score": 70,
"call_score_breakdown": {
"components": {
"interest_intent": 20,
"use_case_relevance": 10,
"timeline_urgency": 10,
"authority_influence": 10,
"engagement_quality": 10,
"next_step_commitment": 10
},
"total": 70,
"reason": "The user was actively engaged, showed strong interest in the offering, and agreed to a site visit."
}
},
"summary": {
"headline": "Site visit scheduled for tomorrow at 11 AM to explore the 2 BHK configuration.",
"key_points": [
"Customer showed interest in a 2 BHK residence.",
"Agent provided details about the residential project and its features.",
"Customer scheduled a site visit for tomorrow at 11:00 AM.",
"Agent confirmed the visit details and assured assistance during the visit."
]
},
"lead": {
"name": "Jane Doe",
"labels": [
"Interested"
],
"objections": [],
"pain_points": [],
"questions_asked": [
"What kind of space are you picturing for your family?",
"Can you repeat that once?",
"What are the available configurations?"
]
},
"structured_data": {
"status": "Qualified",
"outcome": "Call Disconnected",
"lead_intent": "High",
"end_call_reason": "Call Disconnected"
},
"next_action": {
"label": [
"Agent to schedule site visit for tomorrow at 11 AM",
"Agent to send visit details via WhatsApp and SMS"
],
"callback_requested": false,
"scheduled_at": null
},
"follow_up": {
"required": false,
"state": "skipped_inbound_call",
"reason": "Outcome falls under stop list conditions. No follow-up required.",
"next_at": null,
"attempt": 1,
"attempts_remaining": 1,
"policy": {
"max_call_attempts": 2,
"max_followup_attempts": 1,
"daily_limit": 3,
"next_call_attempt_number": null
}
},
"success_evaluation": {
"status": "completed",
"reason": "",
"result": 8
},
"call_evaluation": null,
"redial": {
"status": null
},
"skipped": [
{
"stage": "call_evaluation",
"reason": "policy:disabled_in_config"
},
{
"stage": "realtime_agent_evaluation",
"reason": "policy:disabled_in_config"
},
{
"stage": "spam_detection",
"reason": "policy:disabled_in_config"
}
]
},
"call_traces": [
{
"status": "callRequested",
"timestamp": "2026-02-07T05:57:44.000000",
"previous_status": "",
"message": "call status set: callRequested",
"event": "status_change",
"end_reason": "",
"error_message": ""
},
{
"status": "ringing",
"timestamp": "2026-02-07T05:57:45.000000",
"previous_status": "callRequested",
"message": "call status changed: callRequested -> ringing",
"event": "status_change",
"end_reason": "",
"error_message": ""
},
{
"status": "active",
"timestamp": "2026-02-07T05:57:46.000000",
"previous_status": "ringing",
"message": "call status changed: ringing -> active",
"event": "status_change",
"end_reason": "",
"error_message": ""
},
{
"status": "hungUp",
"timestamp": "2026-02-07T06:06:24.000000",
"previous_status": "active",
"message": "call status changed: active -> hungUp | reason: USER_HUNG_UP_IN_CALL",
"event": "status_change",
"end_reason": "USER_HUNG_UP_IN_CALL",
"error_message": ""
},
{
"status": "connected",
"timestamp": "2026-02-07T06:06:29.000000",
"previous_status": "callEnded",
"message": "call finalized: connected",
"event": "finalized",
"end_reason": "USER_HUNG_UP_IN_CALL",
"error_message": ""
}
],
"error": "",
"error_code": "",
"end_reason": "User"
},
"attachments": [],
"assignee": "space-agent-8qmk42nslp91wrh3dz7btxc4",
"status": "completed",
"execution_type": "call",
"ref_id": "6902fb5840a736e125e80ebc",
"failure_count": 0,
"last_failure_reason": null,
"provider": null,
"retry_attempt": 0,
"referenced_task": null,
"follow_up_count": null,
"follow_up_chain_id": null,
"last_status_change": "2026-02-07T05:51:51.606885",
"scheduled_timestamp": null
}
]
}
{
"message": "Agent not found"
}
Get Tasks by Agent Handle
Fetch all tasks assigned to a specific agent/pilot using their handle. This returns full task metadata including user info, input payloads, call output, transcripts, and execution details.Prerequisites: Make sure you have your API Token ready. See Authentication for details.
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| agent_handle | string | Yes | Unique handle/identifier of the agent |
You can get the
agent_handle by hitting the Get All Agents API. The handle field in the response is your Agent Handle.Query Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| page | integer | No | Page number to fetch, 1-based. Defaults to 1 |
| page_size | integer | No | Tasks per page. Defaults to 20 |
count is the total number of tasks for the agent, not the size of the current page — data holds at most page_size items. Page through until you have collected count tasks.Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | API Key format: Token <token> |
| Content-Type | string | Yes | application/json |
Response Fields
| Field | Type | Description |
|---|---|---|
| count | integer | Total number of tasks |
| status_code | integer | HTTP status code |
| message | string | Response message |
| data | array | Array of task objects |
Task Object Fields
| Field | Type | Description |
|---|---|---|
| _id | string | Internal task document ID |
| thread_id | string | Thread identifier |
| user_info | object | User details (email, full_name) |
| task_id | string | Unique task identifier |
| run_id | string | Parent run identifier |
| task | object | Task definition with objective |
| input | object | Input data for the task |
| output | object | Task output with call details |
| attachments | array | List of attachments |
| assignee | string | Agent handle assigned to the task |
| status | string | Task status: pending, completed, failed |
| execution_type | string | Type of execution: call, email, etc. |
| ref_id | string | Reference ID linking to input data |
| failure_count | integer | Number of failed attempts |
| last_failure_reason | string | Reason for last failure (null if none) |
| retry_attempt | integer | Current retry attempt number |
| last_status_change | string | Timestamp of last status change |
| scheduled_timestamp | string | Scheduled execution timestamp (null if now) |
Additional Task Object Fields
status also supports the in_progress value.
| Field | Type | Description |
|---|---|---|
| space_id | string | Numeric id of the space the task belongs to |
| user | string | User identifier that triggered the task (empty for inbound calls) |
| user_org_id | string | Numeric id of the owning organisation |
| created | string | Task creation timestamp |
| modified | string | Timestamp of the last write to the task document |
| collection_ref | string | Collection holding the source rows: collection_data_<space_token> |
| provider | string | null | Telephony provider used for the call (null if not resolved yet) |
| referenced_task | string | null | task_id this task was spawned from (follow-ups, retries) |
| follow_up_count | integer | null | Number of follow-up tasks created off this task |
| follow_up_chain_id | string | null | Groups a task and all of its follow-ups into one chain |
user_info and task are objects, but they come back empty ({}) for calls not created from a lead payload with an objective. Do not assume task.objective exists.Output Object Fields
| Field | Type | Description |
|---|---|---|
| call_id | string | Unique call identifier |
| call_end_reason | string | Reason for call ending |
| start_time | string | Call start timestamp |
| end_time | string | Call end timestamp |
| assistant_number | string | Outbound phone number used |
| call_summary | string | AI-generated summary of the call |
| duration | number | Call duration in seconds |
| recording_url | string | URL to call recording |
| transcript | array | Array of conversation messages |
| post_call_data | object | Post-call analysis data |
| call_type | string | Direction of call: outbound, inbound |
| call_status | string | Status of the call: completed, etc. |
output is only fully populated once the call finishes. While status is in_progress, it returns a partial output with just call_type, call_status and call_end_reason.Additional Output Object Fields
| Field | Type | Description |
|---|---|---|
| customer | string | Customer name resolved for the call (empty if unknown) |
| contact_number | string | Number dialled, or that dialled in, in E.164 |
| cost | number | Billed cost of the call |
| metadata | object | cost, type and a usage map for the call |
post_call_data (schema_version: 2)
post_call_data is grouped:
| Field | Type | Description |
|---|---|---|
| schema_version | integer | Always 2 for this shape. Branch on this field |
| analytics | object | sentiment, engagement, tone, contact_status, call_score, call_score_breakdown |
| summary | object | headline plus a key_points array |
| lead | object | name, labels, objections, pain_points, questions_asked |
| structured_data | object | Playbook-defined extraction fields — keys vary per agent |
| next_action | object | label, callback_requested, scheduled_at |
| follow_up | object | required, state, reason, next_at, attempt, attempts_remaining, policy |
| evaluation | object | null | Playbook evaluation result (null when disabled) |
| call_evaluation | object | null | Call-quality evaluation result (null when disabled) |
| redial | object | status of an automatic redial |
| skipped | array | Post-call stages that did not run, each {stage, reason} |
| post_call_usage | object | Provider and token usage for billing — see below |
follow_up.policy
| Field | Type | Description |
|---|---|---|
| max_call_attempts | integer | Total call attempts allowed for the contact |
| max_followup_attempts | integer | Follow-up attempts allowed after a connect |
| daily_limit | integer | Attempts allowed per day |
| next_call_attempt_number | integer | Attempt number the next call will use |
post_call_usage
| Field | Type | Description |
|---|---|---|
| thread_id | string | Thread the call ran on — matches task_id |
| room_name | string | Media room name (empty for calls that never connected) |
| agent_id | string | Agent handle that served the call |
| org_id | string | null | Organisation id resolved at billing time |
| space_token | string | null | Space token resolved at billing time |
| call_start | string | Billing window start |
| call_end | string | Billing window end |
| call_duration_s | string | Billed duration in seconds, sent as a string |
| providers | object | llm_provider, llm_model, stt_provider, stt_model, tts_provider, tts_model |
| raw_counters | object | Raw meters: LLM prompt/completion/cached tokens, TTS characters, STT audio duration |
| sku_deltas | array | Billable units, each {codename, raw, unit_scale} — all values are strings |
Every numeric value under
post_call_usage (call_duration_s, raw_counters, sku_deltas) is a string, not a number. Cast before doing arithmetic.Common Error Codes
| Status Code | Description |
|---|---|
| 200 | Success - Data fetched successfully |
| 206 | Partial Content - Business logic error occurred |
| 400 | Bad Request - Invalid parameters provided |
| 401 | Unauthorized - Invalid or missing API token |
| 403 | Forbidden - Access denied to the resource |
| 404 | Not Found - Agent not found |
| 500 | Internal Server Error - Server-side error |
Code Examples
const axios = require('axios');
const headers = {
'Authorization': 'Token your-api-token',
'Content-Type': 'application/json'
};
// Get tasks by agent handle
const getTasksByAgentHandle = async (agentHandle) => {
const response = await axios.get(
`https://unpod.ai/api/v2/platform/agents/${agentHandle}/tasks/`,
{ headers }
);
console.log(`Total tasks: ${response.data.count}`);
response.data.data.forEach(task => {
console.log(`Task ${task.task_id}: ${task.status} (${task.execution_type})`);
});
return response.data.data;
};
// Example usage
getTasksByAgentHandle('space-agent-8qmk42nslp91wrh3dz7btxc4');
import requests
headers = {
'Authorization': 'Token your-api-token',
'Content-Type': 'application/json'
}
def get_tasks_by_agent_handle(agent_handle: str):
"""Get all tasks assigned to a specific agent"""
url = f'https://unpod.ai/api/v2/platform/agents/{agent_handle}/tasks/'
response = requests.get(url, headers=headers)
data = response.json()
print(f"Total tasks: {data['count']}")
for task in data['data']:
print(f"Task {task['task_id']}: {task['status']} ({task['execution_type']})")
return data['data']
# Example usage
get_tasks_by_agent_handle('space-agent-8qmk42nslp91wrh3dz7btxc4')
# Get tasks by agent handle
curl -X GET "https://unpod.ai/api/v2/platform/agents/space-agent-8qmk42nslp91wrh3dz7btxc4/tasks/" \
-H "Authorization: Token your-api-token" \
-H "Content-Type: application/json"
Best Practices
- Agent Handle: Use the exact agent handle from the Get All Agents response
- Transcript Analysis: Use the
transcriptfield in the output for detailed conversation analysis - Retry Logic: Check
failure_countandlast_failure_reasonfor failed tasks to understand issues - Recording Access: Store
recording_urlfrom output for compliance and quality review - Security: Keep API tokens secure and rotate them regularly
Authorizations
Format: Token
Headers
Organization domain handle
Example:
"unpod.tv"
Path Parameters
Example:
"space-agent-8qmk42nslp91wrh3dz7btxc4"
Response
List of tasks for the agent
Was this page helpful?
⌘I
Get Tasks by Agent Handle
curl --request GET \
--url https://unpod.ai/api/v2/platform/agents/{agent_handle}/tasks/ \
--header 'Authorization: <api-key>' \
--header 'Org-Handle: <org-handle>'import requests
url = "https://unpod.ai/api/v2/platform/agents/{agent_handle}/tasks/"
headers = {
"Org-Handle": "<org-handle>",
"Authorization": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Org-Handle': '<org-handle>', Authorization: '<api-key>'}
};
fetch('https://unpod.ai/api/v2/platform/agents/{agent_handle}/tasks/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://unpod.ai/api/v2/platform/agents/{agent_handle}/tasks/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Org-Handle: <org-handle>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://unpod.ai/api/v2/platform/agents/{agent_handle}/tasks/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Org-Handle", "<org-handle>")
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://unpod.ai/api/v2/platform/agents/{agent_handle}/tasks/")
.header("Org-Handle", "<org-handle>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://unpod.ai/api/v2/platform/agents/{agent_handle}/tasks/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Org-Handle"] = '<org-handle>'
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"count": 1,
"status_code": 200,
"message": "Tasks Fetched Successfully",
"data": [
{
"_id": "697debb84c27faa892bfa0cd",
"space_id": "42",
"thread_id": "",
"user": "",
"user_org_id": "101",
"user_info": {},
"created": "2026-02-07T05:51:51.607000",
"modified": "2026-02-07T06:06:30.000000",
"task_id": "T1a2b3c4dfe9a11f0878d43cd8a99e069",
"run_id": "R1a2b3c4cfe9a11f0878d43cd8a99e069",
"collection_ref": "collection_data_SPTKN4XQ7M2VB9YH3KD8WZ1L",
"task": {},
"input": {
"contact_number": "+911234567890",
"quality": "good",
"name": "Jane Doe",
"token": "SPTKN4XQ7M2VB9YH3KD8WZ1L",
"space_token": "SPTKN4XQ7M2VB9YH3KD8WZ1L",
"org_id": 101,
"missing_space_context": false
},
"output": {
"call_id": "Unpod Bridge_1234567890_AbCdEfGhIjKl",
"customer": "Jane Doe",
"contact_number": "+911234567890",
"call_type": "inbound",
"call_status": "connected",
"call_end_reason": "USER_HUNG_UP_IN_CALL",
"transcript": [
{
"role": "assistant",
"content": "Hello, main Sunrise Heights se bol rahi hoon. Kya abhi baat karne ka sahi samay hai?",
"timestamp": "2026-02-07 05:58:00.000000",
"participant": "agent",
"start_time": "2026-02-07T05:57:55.000000",
"end_time": "2026-02-07T05:58:00.000000",
"language": "hi"
},
{
"role": "user",
"content": "Haan, boliye.",
"timestamp": "2026-02-07 05:58:05.000000",
"participant": "sip_1234567890",
"start_time": "2026-02-07T05:58:03.000000",
"end_time": "2026-02-07T05:58:05.000000",
"language": "hi"
},
{
"role": "assistant",
"content": "Thank you! Yeh call aapke Sunrise Heights me dikhaye gaye interest ke regarding hai. Kya main continue karoon?",
"timestamp": "2026-02-07 05:58:15.000000",
"participant": "agent",
"start_time": "2026-02-07T05:58:08.000000",
"end_time": "2026-02-07T05:58:15.000000",
"language": "hi"
},
{
"role": "user",
"content": "Haan, main 2 BHK ke baare me dekh rahi thi.",
"timestamp": "2026-02-07 05:58:22.000000",
"participant": "sip_1234567890",
"start_time": "2026-02-07T05:58:19.000000",
"end_time": "2026-02-07T05:58:22.000000",
"language": "hi"
},
{
"role": "assistant",
"content": "Bilkul. Hamare paas spacious 2 BHK residences hain, zero-wastage layouts ke saath. Kya main aapki site visit schedule kar doon?",
"timestamp": "2026-02-07 05:58:40.000000",
"participant": "agent",
"start_time": "2026-02-07T05:58:25.000000",
"end_time": "2026-02-07T05:58:40.000000",
"language": "hi"
},
{
"role": "user",
"content": "Haan, kal 11 baje ke liye schedule kar dijiye.",
"timestamp": "2026-02-07 05:58:48.000000",
"participant": "sip_1234567890",
"start_time": "2026-02-07T05:58:45.000000",
"end_time": "2026-02-07T05:58:48.000000",
"language": "hi"
},
{
"role": "assistant",
"content": "Perfect. Maine aapki visit kal 11 AM ke liye schedule kar di hai. Hamare sales expert aapko assist karenge. Dhanyavaad!",
"timestamp": "2026-02-07 05:59:05.000000",
"participant": "agent",
"start_time": "2026-02-07T05:58:52.000000",
"end_time": "2026-02-07T05:59:05.000000",
"language": "hi"
}
],
"recording_url": "https://cdn.unpod.ai/recordings/CALL_AbCdEfGhIjKl.mp3",
"files": [],
"start_time": "2026-02-07T05:57:45",
"end_time": "2026-02-07T06:06:25",
"call_timings": {
"call_dialed_at": "2026-02-07T05:57:44",
"call_connected_at": "2026-02-07T05:57:45",
"call_ended_at": "2026-02-07T06:06:25",
"ring_duration": 1,
"talk_duration": 520
},
"duration": 520,
"provider_call_id": "AbCdEfGhIjKlMnOpQrStUv@unpod.ai",
"assistant_number": "+919876543210",
"metadata": {
"cost": 0.600075,
"type": "",
"usage": {
"llm_provider": "Unpod",
"llm_model": "google/gemma-4-31b-it",
"tts_provider": "elevenlabs",
"tts_model": "eleven_v3",
"stt_provider": "soniox",
"stt_model": "stt-rt-v5",
"llm_prompt_tokens": 1199715,
"llm_completion_tokens": 1112,
"tts_characters_count": 4635,
"stt_audio_duration": 508.2,
"costs": {
"llm_cost": 0,
"stt_cost": 0.018,
"tts_cost": 0.4635
},
"total_cost": 0.5715
},
"provider": "livekit",
"room_name": "Unpod Bridge_1234567890_AbCdEfGhIjKl"
},
"post_call_data": {
"schema_version": 2,
"analytics": {
"sentiment": "positive",
"engagement": "high",
"tone": "friendly",
"contact_status": "active",
"call_score": 70,
"call_score_breakdown": {
"components": {
"interest_intent": 20,
"use_case_relevance": 10,
"timeline_urgency": 10,
"authority_influence": 10,
"engagement_quality": 10,
"next_step_commitment": 10
},
"total": 70,
"reason": "The user was actively engaged, showed strong interest in the offering, and agreed to a site visit."
}
},
"summary": {
"headline": "Site visit scheduled for tomorrow at 11 AM to explore the 2 BHK configuration.",
"key_points": [
"Customer showed interest in a 2 BHK residence.",
"Agent provided details about the residential project and its features.",
"Customer scheduled a site visit for tomorrow at 11:00 AM.",
"Agent confirmed the visit details and assured assistance during the visit."
]
},
"lead": {
"name": "Jane Doe",
"labels": [
"Interested"
],
"objections": [],
"pain_points": [],
"questions_asked": [
"What kind of space are you picturing for your family?",
"Can you repeat that once?",
"What are the available configurations?"
]
},
"structured_data": {
"status": "Qualified",
"outcome": "Call Disconnected",
"lead_intent": "High",
"end_call_reason": "Call Disconnected"
},
"next_action": {
"label": [
"Agent to schedule site visit for tomorrow at 11 AM",
"Agent to send visit details via WhatsApp and SMS"
],
"callback_requested": false,
"scheduled_at": null
},
"follow_up": {
"required": false,
"state": "skipped_inbound_call",
"reason": "Outcome falls under stop list conditions. No follow-up required.",
"next_at": null,
"attempt": 1,
"attempts_remaining": 1,
"policy": {
"max_call_attempts": 2,
"max_followup_attempts": 1,
"daily_limit": 3,
"next_call_attempt_number": null
}
},
"success_evaluation": {
"status": "completed",
"reason": "",
"result": 8
},
"call_evaluation": null,
"redial": {
"status": null
},
"skipped": [
{
"stage": "call_evaluation",
"reason": "policy:disabled_in_config"
},
{
"stage": "realtime_agent_evaluation",
"reason": "policy:disabled_in_config"
},
{
"stage": "spam_detection",
"reason": "policy:disabled_in_config"
}
]
},
"call_traces": [
{
"status": "callRequested",
"timestamp": "2026-02-07T05:57:44.000000",
"previous_status": "",
"message": "call status set: callRequested",
"event": "status_change",
"end_reason": "",
"error_message": ""
},
{
"status": "ringing",
"timestamp": "2026-02-07T05:57:45.000000",
"previous_status": "callRequested",
"message": "call status changed: callRequested -> ringing",
"event": "status_change",
"end_reason": "",
"error_message": ""
},
{
"status": "active",
"timestamp": "2026-02-07T05:57:46.000000",
"previous_status": "ringing",
"message": "call status changed: ringing -> active",
"event": "status_change",
"end_reason": "",
"error_message": ""
},
{
"status": "hungUp",
"timestamp": "2026-02-07T06:06:24.000000",
"previous_status": "active",
"message": "call status changed: active -> hungUp | reason: USER_HUNG_UP_IN_CALL",
"event": "status_change",
"end_reason": "USER_HUNG_UP_IN_CALL",
"error_message": ""
},
{
"status": "connected",
"timestamp": "2026-02-07T06:06:29.000000",
"previous_status": "callEnded",
"message": "call finalized: connected",
"event": "finalized",
"end_reason": "USER_HUNG_UP_IN_CALL",
"error_message": ""
}
],
"error": "",
"error_code": "",
"end_reason": "User"
},
"attachments": [],
"assignee": "space-agent-8qmk42nslp91wrh3dz7btxc4",
"status": "completed",
"execution_type": "call",
"ref_id": "6902fb5840a736e125e80ebc",
"failure_count": 0,
"last_failure_reason": null,
"provider": null,
"retry_attempt": 0,
"referenced_task": null,
"follow_up_count": null,
"follow_up_chain_id": null,
"last_status_change": "2026-02-07T05:51:51.606885",
"scheduled_timestamp": null
}
]
}
{
"message": "Agent not found"
}