Organisation
Get all Organizations
GET
/
api
/
v2
/
platform
/
organizations
/
Get Organizations
curl --request GET \
--url https://unpod.ai/api/v2/platform/organizations/ \
--header 'Authorization: <api-key>' \
--header 'Org-Handle: <org-handle>'import requests
url = "https://unpod.ai/api/v2/platform/organizations/"
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/organizations/', 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/organizations/",
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/organizations/"
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/organizations/")
.header("Org-Handle", "<org-handle>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://unpod.ai/api/v2/platform/organizations/")
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": 3,
"status_code": 200,
"message": "Organizations fetched successfully",
"data": [
{
"id": 1,
"name": "Unpod TV",
"domain_handle": "unpod.tv",
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": 2,
"name": "Recalll",
"domain_handle": "recalll.co",
"created_at": "2024-03-20T08:00:00Z"
}
]
}
{
"status_code": 401,
"message": "Authentication credentials were not provided."
}
{
"count": 3,
"status_code": 200,
"message": "Organizations fetched successfully",
"data": [
{
"id": 1,
"name": "Unpod TV",
"domain_handle": "unpod.tv",
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": 2,
"name": "Recalll",
"domain_handle": "recalll.co",
"created_at": "2024-03-20T08:00:00Z"
}
]
}
{
"status_code": 401,
"message": "Authentication credentials were not provided."
}
Organizations API
Retrieve a list of all organizations associated with your API token. Thedomain_handle field in the response is used as the Org-Handle header in subsequent API requests.
Response Fields
| Field | Type | Description |
|---|---|---|
| count | integer | Total number of organizations |
| status_code | integer | HTTP status code |
| message | string | Response message |
| data | array | Array of organization objects |
Organization Object Fields
| Field | Type | Description |
|---|---|---|
| id | integer | Unique organization identifier |
| name | string | Organization display name |
| domain_handle | string | Domain handle used as Org-Handle in API requests |
| created_at | string | Organization 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 organizations
const getOrganizations = async () => {
const response = await axios.get(
'https://unpod.ai/api/v2/platform/organizations/',
{ headers }
);
console.log(`Total organizations: ${response.data.count}`);
response.data.data.forEach(org => {
console.log(`${org.name} - Handle: ${org.domain_handle}`);
});
return response.data.data;
};
// Example usage
getOrganizations();
import requests
headers = {
'Authorization': 'Token your-api-token',
'Org-Handle': 'your-org-handle'
}
def get_organizations():
"""Get all organizations"""
url = 'https://unpod.ai/api/v2/platform/organizations/'
response = requests.get(url, headers=headers)
data = response.json()
print(f"Total organizations: {data['count']}")
for org in data['data']:
print(f"{org['name']} - Handle: {org['domain_handle']}")
return data['data']
# Example usage
get_organizations()
# Get all organizations
curl -X GET "https://unpod.ai/api/v2/platform/organizations/" \
-H "Authorization: Token your-api-token" \
-H "Org-Handle: your-org-handle"
Best Practices
- Org-Handle: Use the
domain_handlefrom the response as theOrg-Handleheader in all subsequent requests - Caching: Cache organization data locally to reduce API calls since organizations change infrequently
- Error Handling: Always handle potential errors and edge cases
- Security: Keep API tokens secure and rotate them regularly
- Multiple Orgs: If you have access to multiple organizations, store all handles and switch between them as needed
Was this page helpful?
⌘I
Get Organizations
curl --request GET \
--url https://unpod.ai/api/v2/platform/organizations/ \
--header 'Authorization: <api-key>' \
--header 'Org-Handle: <org-handle>'import requests
url = "https://unpod.ai/api/v2/platform/organizations/"
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/organizations/', 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/organizations/",
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/organizations/"
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/organizations/")
.header("Org-Handle", "<org-handle>")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://unpod.ai/api/v2/platform/organizations/")
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": 3,
"status_code": 200,
"message": "Organizations fetched successfully",
"data": [
{
"id": 1,
"name": "Unpod TV",
"domain_handle": "unpod.tv",
"created_at": "2024-01-15T10:30:00Z"
},
{
"id": 2,
"name": "Recalll",
"domain_handle": "recalll.co",
"created_at": "2024-03-20T08:00:00Z"
}
]
}
{
"status_code": 401,
"message": "Authentication credentials were not provided."
}