Skip to main content
GET
/
api
/
v2
/
platform
/
spaces
/
{space_token}
/
runs
/
{run_id}
/
tasks
Get Detailed Tasks for a Specific Run
curl --request GET \
  --url http://localhost:3001/api/v2/platform/spaces/{space_token}/runs/{run_id}/tasks/ \
  --header 'Authorization: <api-key>' \
  --header 'Org-Handle: <org-handle>'
{
  "count": 9,
  "status_code": 200,
  "message": "Tasks Fetched Successfully",
  "data": [
    {
      "_id": "697debb84c27faa892bfa0cc",
      "task_id": "T8ff2ccdffe9a11f0878d43cd8a99e069",
      "run_id": "Recac64fe03e911f1878d43cd8a99e069",
      "assignee": "space-agent-8qmk42nslp91wrh3dz7btxc4",
      "status": "completed",
      "execution_type": "call"
    }
  ]
}
{
  "count": 9,
  "status_code": 200,
  "message": "Tasks Fetched Successfully",
  "data": [
    {
      "_id": "697debb84c27faa892bfa0cc",
      "task_id": "T8ff2ccdffe9a11f0878d43cd8a99e069",
      "run_id": "Recac64fe03e911f1878d43cd8a99e069",
      "assignee": "space-agent-8qmk42nslp91wrh3dz7btxc4",
      "status": "completed",
      "execution_type": "call"
    }
  ]
}

Get Detailed Tasks for a Specific Run

Fetch all tasks for a specific run, including complete input, output, call transcript, costs, analysis, artifacts, and provider metadata. This endpoint is used when you need deep inspection of how a run executed each task.
Prerequisites: Make sure you have your API Token ready. See Authentication for details.

Path Parameters

NameTypeRequiredDescription
space_tokenstringYesPublic token of the space
run_idstringYesThe run ID whose tasks to retrieve
You can get the space_token from the Get All Spaces API. The run_id can be obtained from the Get All Runs API response.

Headers

NameTypeRequiredDescription
AuthorizationstringYesAPI Key format: Token <token>
Content-TypestringYesapplication/json

Response Fields

FieldTypeDescription
countintegerTotal number of tasks
status_codeintegerHTTP status code
messagestringResponse message
dataarrayArray of task objects

Task Object Fields

FieldTypeDescription
_idstringInternal task document ID
thread_idstringThread identifier
user_infoobjectUser details (email, full_name)
task_idstringUnique task identifier
run_idstringParent run identifier
taskobjectTask definition with objective
inputobjectInput data for the task
outputobjectTask output including call details
assigneestringAgent handle assigned to the task
statusstringTask status: pending, completed, failed
execution_typestringType of execution: call, email, etc.
createdstringTask creation timestamp
modifiedstringLast modified timestamp

Output Object Fields

FieldTypeDescription
call_idstringUnique call identifier
start_timestringCall start timestamp
end_timestringCall end timestamp
durationnumberCall duration in seconds
recording_urlstringURL to call recording
transcriptarrayArray of conversation messages
post_call_dataobjectPost-call analysis data
call_typestringDirection: outbound, inbound
call_statusstringStatus of the call

Common Error Codes

Status CodeDescription
200Success - Data fetched successfully
206Partial Content - Business logic error occurred
400Bad Request - Invalid parameters provided
401Unauthorized - Invalid or missing API token
403Forbidden - Access denied to the resource
404Not Found - Space or Run not found
500Internal Server Error - Server-side error

Code Examples

const axios = require('axios');

const headers = {
  'Authorization': 'Token your-api-token',
  'Content-Type': 'application/json'
};

// Get tasks for a specific run
const getRunTasks = async (spaceToken, runId) => {
  const response = await axios.get(
    `https://unpod.dev/api/v2/platform/spaces/${spaceToken}/runs/${runId}/tasks/`,
    { headers }
  );
  console.log(`Total tasks: ${response.data.count}`);
  response.data.data.forEach(task => {
    console.log(`Task ${task.task_id}: ${task.status}`);
    if (task.output?.duration) {
      console.log(`  Duration: ${task.output.duration}s`);
    }
  });
  return response.data.data;
};

// Example usage
getRunTasks('8KZAMRAHSXXXXXXMAYNASMJC', 'Recac64fe03e911f1878d43cd8a99e069');

Best Practices

  1. Run ID: Always retrieve the run_id from the Get All Runs endpoint first
  2. Transcript Review: Use the transcript array in output for conversation quality analysis
  3. Recording Access: Store recording_url for compliance, QA, and playback
  4. Post-call Data: Check post_call_data.summary for AI-generated call summaries and outcomes
  5. Error Handling: Always handle potential errors and edge cases
  6. Security: Keep API tokens secure and rotate them regularly

Authorizations

Authorization
string
header
required

Format: Token

Headers

Org-Handle
string
required

Organization domain handle

Example:

"unpod"

Path Parameters

space_token
string
required
Example:

"8KZRTQP7BNW5XEDLORYUHMJC"

run_id
string
required
Example:

"R40fe5eface1511f082ac156368e7acc4"

Response

List of tasks for the run