Get User Workspaces
curl --request GET \
--url https://app.cardclan.io/api/integration/workspaces \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.cardclan.io/api/integration/workspaces"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.cardclan.io/api/integration/workspaces', 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://app.cardclan.io/api/integration/workspaces",
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: Bearer <token>"
],
]);
$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://app.cardclan.io/api/integration/workspaces"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.cardclan.io/api/integration/workspaces")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.cardclan.io/api/integration/workspaces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"key": "workspace",
"choices": [
{
"key": "60f7b2b5b8f4a20015a4f5a4",
"label": "Workspace Id",
"value": "My Business Workspace",
"id": "60f7b2b5b8f4a20015a4f5a4",
"name": "My Business Workspace"
}
]
}
]{
"error": "Bad Request",
"message": "Card ID is required",
"statusCode": 400,
"timestamp": "2024-01-15T10:30:00.000Z"
}Integration API
Get Workspaces
Retrieves all workspaces accessible to the authenticated user
GET
/
integration
/
workspaces
Get User Workspaces
curl --request GET \
--url https://app.cardclan.io/api/integration/workspaces \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.cardclan.io/api/integration/workspaces"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.cardclan.io/api/integration/workspaces', 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://app.cardclan.io/api/integration/workspaces",
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: Bearer <token>"
],
]);
$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://app.cardclan.io/api/integration/workspaces"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.cardclan.io/api/integration/workspaces")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.cardclan.io/api/integration/workspaces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"key": "workspace",
"choices": [
{
"key": "60f7b2b5b8f4a20015a4f5a4",
"label": "Workspace Id",
"value": "My Business Workspace",
"id": "60f7b2b5b8f4a20015a4f5a4",
"name": "My Business Workspace"
}
]
}
]{
"error": "Bad Request",
"message": "Card ID is required",
"statusCode": 400,
"timestamp": "2024-01-15T10:30:00.000Z"
}Retrieves all workspaces accessible to the authenticated user. Workspaces are containers that organize your cards and team collaboration in CardClan.
Response Details
The response returns an array containing workspace choices formatted for integration platforms:- key: Always “workspace” to identify the data type
- choices: Array of available workspaces with their details
- id: Unique workspace identifier (use this for other API calls)
- name: Human-readable workspace name
- key: Same as ID (for integration platform compatibility)
- label: Description of the field type
- value: Display name for the workspace
Use Cases
- Dynamic Workspace Selection: Let users choose which workspace to send cards from
- Multi-Tenant Applications: Support customers with multiple workspaces
- Automation Setup: Discover available workspaces for workflow configuration
- Access Validation: Verify which workspaces the integration key can access
Response Example
[
{
"key": "workspace",
"choices": [
{
"key": "60f7b2b5b8f4a20015a4f5a4",
"label": "Workspace Id",
"value": "Marketing Team",
"id": "60f7b2b5b8f4a20015a4f5a4",
"name": "Marketing Team"
},
{
"key": "60f7b2b5b8f4a20015a4f5a5",
"label": "Workspace Id",
"value": "Sales Team",
"id": "60f7b2b5b8f4a20015a4f5a5",
"name": "Sales Team"
}
]
}
]
Next Steps
After getting workspaces, you typically want to:- Get Cards: Use the workspace ID to retrieve available cards
- Set Up Integration Config: Create configurations linking cards to workflows
- Send Cards: Execute card delivery using the workspace’s cards
Was this page helpful?