Update Workspace
Update a Workspace.
POST
/
organizations
/
{organizationId}
/
workspaces
/
{workspaceId}
Update Workspace
curl --request POST \
--url https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/workspaces/{workspaceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cicdEnforcedDefault": true,
"description": "This is a test workspace",
"name": "My Workspace"
}
'import requests
url = "https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/workspaces/{workspaceId}"
payload = {
"cicdEnforcedDefault": True,
"description": "This is a test workspace",
"name": "My 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({
cicdEnforcedDefault: true,
description: 'This is a test workspace',
name: 'My Workspace'
})
};
fetch('https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/workspaces/{workspaceId}', 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/{workspaceId}",
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([
'cicdEnforcedDefault' => true,
'description' => 'This is a test workspace',
'name' => 'My 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/{workspaceId}"
payload := strings.NewReader("{\n \"cicdEnforcedDefault\": true,\n \"description\": \"This is a test workspace\",\n \"name\": \"My 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/{workspaceId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cicdEnforcedDefault\": true,\n \"description\": \"This is a test workspace\",\n \"name\": \"My Workspace\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/workspaces/{workspaceId}")
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 \"cicdEnforcedDefault\": true,\n \"description\": \"This is a test workspace\",\n \"name\": \"My 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,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}Authorizations
Path Parameters
Body
application/json
The request body for updating a new Workspace.
Response
OK
Was this page helpful?
⌘I
Update Workspace
curl --request POST \
--url https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/workspaces/{workspaceId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cicdEnforcedDefault": true,
"description": "This is a test workspace",
"name": "My Workspace"
}
'import requests
url = "https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/workspaces/{workspaceId}"
payload = {
"cicdEnforcedDefault": True,
"description": "This is a test workspace",
"name": "My 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({
cicdEnforcedDefault: true,
description: 'This is a test workspace',
name: 'My Workspace'
})
};
fetch('https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/workspaces/{workspaceId}', 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/{workspaceId}",
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([
'cicdEnforcedDefault' => true,
'description' => 'This is a test workspace',
'name' => 'My 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/{workspaceId}"
payload := strings.NewReader("{\n \"cicdEnforcedDefault\": true,\n \"description\": \"This is a test workspace\",\n \"name\": \"My 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/{workspaceId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cicdEnforcedDefault\": true,\n \"description\": \"This is a test workspace\",\n \"name\": \"My Workspace\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/platform/v1beta1/organizations/{organizationId}/workspaces/{workspaceId}")
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 \"cicdEnforcedDefault\": true,\n \"description\": \"This is a test workspace\",\n \"name\": \"My 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,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}{
"message": "<string>",
"requestId": "<string>",
"statusCode": 500,
"fieldErrors": [
{
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
]
}