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 |
|---|---|---|
| run_id | string | Unique run identifier |
| collection_ref | string | Reference to the data collection |
| run_mode | string | Execution engine: prefect, etc. |
| status | string | Run status: completed, running, failed |
| 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 |
|---|---|---|
| thread_id | string | Thread identifier |
| user_info | object | User details (email, full_name) |
| run_id | string | Parent run identifier |
| task_id | string | Unique task identifier |
| 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 |
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