Runs API
The Runs API allows you to manage and monitor execution runs in your Unpod platform. A run represents a batch execution or group of tasks within a space.Prerequisites: Make sure you have your API Token. See Authentication for details.
Get All Runs in a Space
Retrieve all runs associated with a specific space. A run represents a batch execution or group of tasks. This endpoint returns run details including run ID, status, timestamps, and associated user metadata.Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| space_token | string | Yes | Public token identifying the space |
You can get the
space_token by hitting the Get All Spaces API. The token field in the response is your Space Token.Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | API Key format: Token <token> |
| Content-Type | string | Yes | application/json |
Example Request
Success Response (200)
Response Fields
| Field | Type | Description |
|---|---|---|
| count | integer | Total number of runs |
| status_code | integer | HTTP status code |
| message | string | Response message |
| data | array | Array of run objects |
Run Object Fields
| Field | Type | Description |
|---|---|---|
| space_id | string | Space identifier |
| user | string | User ID who created the run |
| thread_id | string | Thread identifier (null if not applicable) |
| run_id | string | Unique run identifier |
| collection_ref | string | Reference to the data collection |
| run_mode | string | Execution mode: dev, prod |
| status | string | Run status: completed, running, failed |
| batch_count | integer | Number of batches in the run |
| created | string | Run creation timestamp |
| modified | string | Last modified timestamp |
Error Response (206 — Fetch Failed)
Get Detailed Tasks for a Specific Run
Fetches 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.Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| space_token | string | Yes | Public token of the space |
| run_id | string | Yes | The run ID whose tasks to retrieve |
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | API Key format: Token <token> |
| Content-Type | string | Yes | application/json |
You can get the
space_token by hitting the Get All Spaces API. The run_id can be obtained from the Get All Runs in a Space API response.Example Request
Success Response (200)
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 |
|---|---|---|
| space_id | string | Space identifier |
| thread_id | string | Thread identifier (null if not applicable) |
| user | string | User ID who created the task |
| user_org_id | string | Organization ID of the user |
| user_info | object | User details (id, email, full_name, token) |
| run_id | string | Parent run identifier |
| task_id | string | Unique task identifier |
| collection_ref | string | Reference to the data collection |
| execution_type | string | Type of execution: call, email, etc. |
| task | object | Task definition with objective |
| input | object | Input data for the task |
| output | object | Task output including call details |
| created | string | Task creation timestamp |
| modified | string | Last modified timestamp |
Input Object Fields
| Field | Type | Description |
|---|---|---|
| document_id | string | Document identifier |
| name | string | Contact name |
| contact_number | string | Contact phone number |
| created | string | Input creation timestamp |
| token | string | Collection token |
| vapi_agent_id | string | Vapi agent identifier |
| number_id | string | Number identifier |
| quality | string | Call quality setting: high, low |
Output Object Fields
| Field | Type | Description |
|---|---|---|
| id | string | Unique call identifier |
| assistantId | string | Assistant identifier |
| phoneNumberId | string | Phone number identifier |
| type | string | Call type: outbound, inbound |
| startedAt | string | Call start timestamp |
| endedAt | string | Call end timestamp |
| transcript | string | Call transcript |
| recordingUrl | string | URL to call recording |
| summary | string | AI-generated call summary |
| createdAt | string | Record creation timestamp |
| updatedAt | string | Record update timestamp |
| orgId | string | Organization identifier |
| cost | number | Cost of the call in USD |
| customer | object | Customer details (number, name) |
Error Response (206 — Business Logic Error)
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 - Space or Run not found |
| 500 | Internal Server Error - Server-side error |
Code Examples
Best Practices
- Space Token: Always use the correct space token for your API requests
- Pagination: For spaces with many runs, implement proper pagination handling
- Error Handling: Always handle potential errors and edge cases
- Filtering: Use status filters to focus on specific run outcomes
- Security: Keep API tokens secure and rotate them regularly