Runs - Executions & calls
Get All Runs in a Space
Retrieve all batch executions associated with a specific space
GET
/
api
/
v2
/
platform
/
spaces
/
{space_token}
/
runs
/
Get All Runs in a Space
curl --request GET \
--url https://unpod.ai/api/v2/platform/spaces/{space_token}/runs/ \
--header 'Authorization: <api-key>' \
--header 'Org-Handle: <org-handle>'import requests
url = "https://unpod.ai/api/v2/platform/spaces/{space_token}/runs/"
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/spaces/{space_token}/runs/', 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/spaces/{space_token}/runs/",
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/spaces/{space_token}/runs/"
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/spaces/{space_token}/runs/")
.header("Org-Handle", "<org-handle>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://unpod.ai/api/v2/platform/spaces/{space_token}/runs/")
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": 9,
"status_code": 200,
"message": "Runs Fetched Successfully",
"data": [
{
"run_id": "Recac64fe03e911f1878d43cd8a99e069",
"collection_ref": "collection_data_SA2W8R6NZRK6C9PO3JSL1J85",
"run_mode": "prefect",
"status": "completed",
"created": "2026-02-07T05:57:45",
"modified": "2026-02-07T05:57:45"
}
]
}
{
"message": "Error fetching runs",
"errors": "Detailed error description"
}
{
"count": 9,
"status_code": 200,
"message": "Runs Fetched Successfully",
"data": [
{
"run_id": "Recac64fe03e911f1878d43cd8a99e069",
"collection_ref": "collection_data_SA2W8R6NZRK6C9PO3JSL1J85",
"run_mode": "prefect",
"status": "completed",
"created": "2026-02-07T05:57:45",
"modified": "2026-02-07T05:57:45"
}
]
}
{
"message": "Error fetching runs",
"errors": "Detailed error description"
}
Get All Runs in a Space
Retrieve all runs associated with a specific space. A run represents a batch execution - a group of tasks triggered together within a space. This endpoint returns run details including run ID, status, timestamps, and associated collection metadata.Prerequisites: Make sure you have your API Token ready. See Authentication for details.
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 |
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, pending |
| created | string | Run creation timestamp |
| modified | string | Last modified timestamp |
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 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 all runs in a space
const getAllRuns = async (spaceToken) => {
const response = await axios.get(
`https://unpod.ai/api/v2/platform/spaces/${spaceToken}/runs/`,
{ headers }
);
console.log(`Total runs: ${response.data.count}`);
response.data.data.forEach(run => {
console.log(`Run ${run.run_id}: ${run.status} (${run.run_mode})`);
});
return response.data.data;
};
// Example usage
getAllRuns('8KZAMRAHSXXXXXXMAYNASMJC');
import requests
headers = {
'Authorization': 'Token your-api-token',
'Content-Type': 'application/json'
}
def get_all_runs(space_token: str):
"""Get all runs in a space"""
url = f'https://unpod.ai/api/v2/platform/spaces/{space_token}/runs/'
response = requests.get(url, headers=headers)
data = response.json()
print(f"Total runs: {data['count']}")
for run in data['data']:
print(f"Run {run['run_id']}: {run['status']} ({run['run_mode']})")
return data['data']
# Example usage
get_all_runs('8KZAMRAHSXXXXXXMAYNASMJC')
# Get all runs in a space
curl -X GET "https://unpod.ai/api/v2/platform/spaces/8KZAMRAHSXXXXXXMAYNASMJC/runs/" \
-H "Authorization: Token your-api-token" \
-H "Content-Type: application/json"
Best Practices
- Space Token: Always use the correct space token for your API requests
- Run ID: Store the
run_idfrom each run to query tasks within that run - Status Monitoring: Poll this endpoint to track the status of ongoing batch executions
- Error Handling: Always handle potential errors and edge cases
- Security: Keep API tokens secure and rotate them regularly
Was this page helpful?
⌘I
Get All Runs in a Space
curl --request GET \
--url https://unpod.ai/api/v2/platform/spaces/{space_token}/runs/ \
--header 'Authorization: <api-key>' \
--header 'Org-Handle: <org-handle>'import requests
url = "https://unpod.ai/api/v2/platform/spaces/{space_token}/runs/"
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/spaces/{space_token}/runs/', 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/spaces/{space_token}/runs/",
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/spaces/{space_token}/runs/"
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/spaces/{space_token}/runs/")
.header("Org-Handle", "<org-handle>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://unpod.ai/api/v2/platform/spaces/{space_token}/runs/")
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": 9,
"status_code": 200,
"message": "Runs Fetched Successfully",
"data": [
{
"run_id": "Recac64fe03e911f1878d43cd8a99e069",
"collection_ref": "collection_data_SA2W8R6NZRK6C9PO3JSL1J85",
"run_mode": "prefect",
"status": "completed",
"created": "2026-02-07T05:57:45",
"modified": "2026-02-07T05:57:45"
}
]
}
{
"message": "Error fetching runs",
"errors": "Detailed error description"
}