curl --request POST \
--url https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/workspaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My Workspace",
"cicdEnforcedDefault": true,
"description": "This is a test workspace"
}
'import requests
url = "https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/workspaces"
payload = {
"name": "My Workspace",
"cicdEnforcedDefault": True,
"description": "This is a test workspace"
}
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: 'My Workspace',
cicdEnforcedDefault: true,
description: 'This is a test workspace'
})
};
fetch('https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/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://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/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' => 'My Workspace',
'cicdEnforcedDefault' => true,
'description' => 'This is a test workspace'
]),
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://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/workspaces"
payload := strings.NewReader("{\n \"name\": \"My Workspace\",\n \"cicdEnforcedDefault\": true,\n \"description\": \"This is a test workspace\"\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://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/workspaces")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My Workspace\",\n \"cicdEnforcedDefault\": true,\n \"description\": \"This is a test workspace\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/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\": \"My Workspace\",\n \"cicdEnforcedDefault\": true,\n \"description\": \"This is a test workspace\"\n}"
response = http.request(request)
puts response.read_body{
"cicdEnforcedDefault": true,
"createdAt": "2023-09-08T12:00:00Z",
"id": "clm8t5u4q000008jq4qoc3036",
"name": "My Workspace",
"organizationId": "clm8t5u4q000008jq4qoc3036",
"updatedAt": "2023-09-08T13:30:00Z",
"createdBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
},
"description": "This is a test workspace",
"organizationName": "My Organization",
"updatedBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
}
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500
}Create Workspace
Create a Workspace.
curl --request POST \
--url https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/workspaces \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "My Workspace",
"cicdEnforcedDefault": true,
"description": "This is a test workspace"
}
'import requests
url = "https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/workspaces"
payload = {
"name": "My Workspace",
"cicdEnforcedDefault": True,
"description": "This is a test workspace"
}
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: 'My Workspace',
cicdEnforcedDefault: true,
description: 'This is a test workspace'
})
};
fetch('https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/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://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/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' => 'My Workspace',
'cicdEnforcedDefault' => true,
'description' => 'This is a test workspace'
]),
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://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/workspaces"
payload := strings.NewReader("{\n \"name\": \"My Workspace\",\n \"cicdEnforcedDefault\": true,\n \"description\": \"This is a test workspace\"\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://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/workspaces")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My Workspace\",\n \"cicdEnforcedDefault\": true,\n \"description\": \"This is a test workspace\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/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\": \"My Workspace\",\n \"cicdEnforcedDefault\": true,\n \"description\": \"This is a test workspace\"\n}"
response = http.request(request)
puts response.read_body{
"cicdEnforcedDefault": true,
"createdAt": "2023-09-08T12:00:00Z",
"id": "clm8t5u4q000008jq4qoc3036",
"name": "My Workspace",
"organizationId": "clm8t5u4q000008jq4qoc3036",
"updatedAt": "2023-09-08T13:30:00Z",
"createdBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
},
"description": "This is a test workspace",
"organizationName": "My Organization",
"updatedBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
}
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the Organization to which the Workspace will belong.
Body
The request body for creating a new Workspace.
Response
OK
Whether CI/CD deploys are enforced by default.
true
The time when the Workspace was created in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ
"2023-09-08T12:00:00Z"
The Workspace's ID.
"clm8t5u4q000008jq4qoc3036"
The Workspace's name.
"My Workspace"
The ID of the organization to which the workspace belongs.
"clm8t5u4q000008jq4qoc3036"
The time when the Workspace was updated in UTC, formatted as YYYY-MM-DDTHH:MM:SSZ
"2023-09-08T13:30:00Z"
Show child attributes
Show child attributes
The Workspace's description.
"This is a test workspace"
The name of the Organization to which the Workspace belongs.
"My Organization"
Show child attributes
Show child attributes
Was this page helpful?