Spaces
Get All Spaces
Retrieve details of all created spaces in your organization
GET
/
api
/
v2
/
platform
/
spaces
/
Get All Spaces
curl --request GET \
--url https://unpod.ai/api/v2/platform/spaces/ \
--header 'Authorization: <api-key>' \
--header 'Org-Handle: <org-handle>'import requests
url = "https://unpod.ai/api/v2/platform/spaces/"
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/', 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/",
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/"
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/")
.header("Org-Handle", "<org-handle>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://unpod.ai/api/v2/platform/spaces/")
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": 207,
"status_code": 200,
"message": "Spaces fetched successfully",
"data": [
{
"id": "sp_001",
"name": "Sales Outreach Q1",
"token": "8KZAMRAHSXXXXXXMAYNASMJC",
"agent_handle": "space-agent-8qmk42nslp91wrh3dz7btxc4",
"created_at": "2026-01-10T08:00:00Z"
}
]
}
{
"status_code": 401,
"message": "Authentication credentials were not provided."
}
{
"count": 207,
"status_code": 200,
"message": "Spaces fetched successfully",
"data": [
{
"id": "sp_001",
"name": "Sales Outreach Q1",
"token": "8KZAMRAHSXXXXXXMAYNASMJC",
"agent_handle": "space-agent-8qmk42nslp91wrh3dz7btxc4",
"created_at": "2026-01-10T08:00:00Z"
}
]
}
{
"status_code": 401,
"message": "Authentication credentials were not provided."
}
Get All Spaces
Retrieve a list of all spaces within your organization. Spaces are containers that organize your tasks, runs, and data collections.Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | API Key format: Token <token> |
| Org-Handle | string | Yes | Organization domain handle |
Response Fields
| Field | Type | Description |
|---|---|---|
| count | integer | Total number of spaces |
| status_code | integer | HTTP status code |
| message | string | Response message |
| data | array | Array of space objects |
Space Object Fields
| Field | Type | Description |
|---|---|---|
| id | string | Unique space identifier |
| name | string | Space display name |
| token | string | Public token for API access (use as space_token) |
| agent_handle | string | Handle of the agent assigned to the space |
| created_at | string | Space creation timestamp (ISO 8601) |
Common Error Codes
| Status Code | Description |
|---|---|
| 200 | Success - Request completed successfully |
| 400 | Bad Request - Invalid parameters provided |
| 401 | Unauthorized - Invalid or missing API token |
| 403 | Forbidden - Access denied to the resource |
| 404 | Not Found - Organization not found |
| 500 | Internal Server Error - Server-side error |
Code Examples
const axios = require('axios');
const headers = {
'Authorization': 'Token your-api-token',
'Org-Handle': 'your-org-handle'
};
// Get all spaces
const getAllSpaces = async () => {
const response = await axios.get(
'https://unpod.ai/api/v2/platform/spaces/',
{ headers }
);
console.log(`Total spaces: ${response.data.count}`);
response.data.data.forEach(space => {
console.log(`${space.name} - Token: ${space.token}`);
});
return response.data.data;
};
// Example usage
getAllSpaces();
import requests
headers = {
'Authorization': 'Token your-api-token',
'Org-Handle': 'your-org-handle'
}
def get_all_spaces():
"""Get all spaces in the organization"""
url = 'https://unpod.ai/api/v2/platform/spaces/'
response = requests.get(url, headers=headers)
data = response.json()
print(f"Total spaces: {data['count']}")
for space in data['data']:
print(f"{space['name']} - Token: {space['token']}")
return data['data']
# Example usage
get_all_spaces()
# Get all spaces
curl -X GET "https://unpod.ai/api/v2/platform/spaces/" \
-H "Authorization: Token your-api-token" \
-H "Org-Handle: your-org-handle"
Best Practices
- Org-Handle: Always include the correct organization handle in your requests
- Space Token: Note the
tokenfield - it is used as thespace_tokenpath parameter in other endpoints - Agent Handle: Use the
agent_handlewhen creating tasks to assign them to the correct agent - Error Handling: Always handle potential errors and edge cases
- Caching: Consider caching space data to reduce API calls since spaces change infrequently
Was this page helpful?
⌘I
Get All Spaces
curl --request GET \
--url https://unpod.ai/api/v2/platform/spaces/ \
--header 'Authorization: <api-key>' \
--header 'Org-Handle: <org-handle>'import requests
url = "https://unpod.ai/api/v2/platform/spaces/"
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/', 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/",
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/"
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/")
.header("Org-Handle", "<org-handle>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://unpod.ai/api/v2/platform/spaces/")
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": 207,
"status_code": 200,
"message": "Spaces fetched successfully",
"data": [
{
"id": "sp_001",
"name": "Sales Outreach Q1",
"token": "8KZAMRAHSXXXXXXMAYNASMJC",
"agent_handle": "space-agent-8qmk42nslp91wrh3dz7btxc4",
"created_at": "2026-01-10T08:00:00Z"
}
]
}
{
"status_code": 401,
"message": "Authentication credentials were not provided."
}