curl --request POST \
--url https://cloud.cdata.com/api/v1/admin/workspaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Finance Analytics",
"description": "Workspace for the finance analytics team.",
"external_id": "tf-workspace-finance"
}
'import requests
url = "https://cloud.cdata.com/api/v1/admin/workspaces"
payload = {
"name": "Finance Analytics",
"description": "Workspace for the finance analytics team.",
"external_id": "tf-workspace-finance"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Finance Analytics',
description: 'Workspace for the finance analytics team.',
external_id: 'tf-workspace-finance'
})
};
fetch('https://cloud.cdata.com/api/v1/admin/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://cloud.cdata.com/api/v1/admin/workspaces",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Finance Analytics',
'description' => 'Workspace for the finance analytics team.',
'external_id' => 'tf-workspace-finance'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cloud.cdata.com/api/v1/admin/workspaces"
payload := strings.NewReader("{\n \"name\": \"Finance Analytics\",\n \"description\": \"Workspace for the finance analytics team.\",\n \"external_id\": \"tf-workspace-finance\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cloud.cdata.com/api/v1/admin/workspaces")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Finance Analytics\",\n \"description\": \"Workspace for the finance analytics team.\",\n \"external_id\": \"tf-workspace-finance\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.cdata.com/api/v1/admin/workspaces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Finance Analytics\",\n \"description\": \"Workspace for the finance analytics team.\",\n \"external_id\": \"tf-workspace-finance\"\n}"
response = http.request(request)
puts response.read_body{
"id": "2b6c1f6e-3a7d-4c8e-9d0a-5e4f3a2b1c00",
"name": "Finance Analytics",
"description": "Workspace for the finance analytics team.",
"external_id": "tf-workspace-finance",
"is_default": false,
"member_count": 0,
"connection_count": 0,
"created_at": "2026-06-01T12:00:00Z",
"created_by": "00000000-0000-0000-0000-000000000001"
}{
"id": "2b6c1f6e-3a7d-4c8e-9d0a-5e4f3a2b1c00",
"name": "Finance Analytics",
"description": "Workspace for the finance analytics team.",
"external_id": "tf-workspace-finance",
"is_default": false,
"member_count": 0,
"connection_count": 0,
"created_at": "2026-06-01T12:00:00Z",
"created_by": "00000000-0000-0000-0000-000000000001"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Missing required field or invalid value."
}
}{
"error": {
"code": "WORKSPACE_NAME_CONFLICT",
"message": "A workspace with this name already exists in the organization."
}
}Create Workspace
Create a workspace. If you supply external_id and a workspace with that external_id already exists, the existing workspace is returned with HTTP 200. This makes repeated applies from infrastructure-as-code tools safe.
curl --request POST \
--url https://cloud.cdata.com/api/v1/admin/workspaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Finance Analytics",
"description": "Workspace for the finance analytics team.",
"external_id": "tf-workspace-finance"
}
'import requests
url = "https://cloud.cdata.com/api/v1/admin/workspaces"
payload = {
"name": "Finance Analytics",
"description": "Workspace for the finance analytics team.",
"external_id": "tf-workspace-finance"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Finance Analytics',
description: 'Workspace for the finance analytics team.',
external_id: 'tf-workspace-finance'
})
};
fetch('https://cloud.cdata.com/api/v1/admin/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://cloud.cdata.com/api/v1/admin/workspaces",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Finance Analytics',
'description' => 'Workspace for the finance analytics team.',
'external_id' => 'tf-workspace-finance'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://cloud.cdata.com/api/v1/admin/workspaces"
payload := strings.NewReader("{\n \"name\": \"Finance Analytics\",\n \"description\": \"Workspace for the finance analytics team.\",\n \"external_id\": \"tf-workspace-finance\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cloud.cdata.com/api/v1/admin/workspaces")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Finance Analytics\",\n \"description\": \"Workspace for the finance analytics team.\",\n \"external_id\": \"tf-workspace-finance\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.cdata.com/api/v1/admin/workspaces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Finance Analytics\",\n \"description\": \"Workspace for the finance analytics team.\",\n \"external_id\": \"tf-workspace-finance\"\n}"
response = http.request(request)
puts response.read_body{
"id": "2b6c1f6e-3a7d-4c8e-9d0a-5e4f3a2b1c00",
"name": "Finance Analytics",
"description": "Workspace for the finance analytics team.",
"external_id": "tf-workspace-finance",
"is_default": false,
"member_count": 0,
"connection_count": 0,
"created_at": "2026-06-01T12:00:00Z",
"created_by": "00000000-0000-0000-0000-000000000001"
}{
"id": "2b6c1f6e-3a7d-4c8e-9d0a-5e4f3a2b1c00",
"name": "Finance Analytics",
"description": "Workspace for the finance analytics team.",
"external_id": "tf-workspace-finance",
"is_default": false,
"member_count": 0,
"connection_count": 0,
"created_at": "2026-06-01T12:00:00Z",
"created_by": "00000000-0000-0000-0000-000000000001"
}{
"error": {
"code": "VALIDATION_ERROR",
"message": "Missing required field or invalid value."
}
}{
"error": {
"code": "WORKSPACE_NAME_CONFLICT",
"message": "A workspace with this name already exists in the organization."
}
}Authorizations
OAuth 2.0 client credentials. Alternatively, you can authenticate with a personal access token (PAT) by sending Authorization: Basic base64(email:PAT).
Scopes
Write access to workspace resources.
Body
Unique display name within the organization.
Purpose or team the workspace serves.
Caller-defined unique identifier for infrastructure-as-code idempotency. Maximum 255 characters. A second POST with the same value returns the existing workspace.
255Response
OK. A workspace with this external_id already exists. Returns the existing workspace.
Workspace identifier.
Workspace display name.
Purpose or team the workspace serves.
Caller-defined identifier used for idempotency.
true for the default workspace that is created automatically for the account. Exactly one workspace per account is the default. The system assigns this value, and you cannot set it.
Number of members in the workspace.
Number of connections in the workspace.
ISO 8601 UTC.
The user who created the workspace.
Was this page helpful?