Skip to main content
GET
/
api
/
v2
/
platform
/
spaces
/
{space_token}
/
runs
Get All Runs in a Space
curl --request GET \
  --url http://localhost:3001/api/v2/platform/spaces/{space_token}/runs/ \
  --header 'Authorization: <api-key>' \
  --header 'Org-Handle: <org-handle>'
{
  "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"
    }
  ]
}
{
  "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"
    }
  ]
}

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

NameTypeRequiredDescription
space_tokenstringYesPublic 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

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

Response Fields

FieldTypeDescription
countintegerTotal number of runs
status_codeintegerHTTP status code
messagestringResponse message
dataarrayArray of run objects

Run Object Fields

FieldTypeDescription
run_idstringUnique run identifier
collection_refstringReference to the data collection
run_modestringExecution engine: prefect, etc.
statusstringRun status: completed, running, failed, pending
createdstringRun creation timestamp
modifiedstringLast modified timestamp

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 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 all runs in a space
const getAllRuns = async (spaceToken) => {
  const response = await axios.get(
    `https://unpod.dev/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');

Best Practices

  1. Space Token: Always use the correct space token for your API requests
  2. Run ID: Store the run_id from each run to query tasks within that run
  3. Status Monitoring: Poll this endpoint to track the status of ongoing batch executions
  4. Error Handling: Always handle potential errors and edge cases
  5. 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"

Response

List of all runs