curl --request POST \
--url https://api.astronomer.io/iam/v1beta1/organizations/{organizationId}/teams/{teamId}/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"organizationRole": "ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER",
"dagRoles": [
{
"deploymentId": "clm8t5u4q000008jq4qoc3031",
"role": "DAG_VIEWER",
"dagId": "my_dag",
"dagTag": "team-a"
}
],
"deploymentRoles": [
{
"deploymentId": "clm8t5u4q000008jq4qoc3031",
"role": "DEPLOYMENT_ADMIN"
}
],
"workspaceRoles": [
{
"role": "WORKSPACE_MEMBER",
"workspaceId": "clm8t5u4q000008jq4qoc3036"
}
]
}
'import requests
url = "https://api.astronomer.io/iam/v1beta1/organizations/{organizationId}/teams/{teamId}/roles"
payload = {
"organizationRole": "ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER",
"dagRoles": [
{
"deploymentId": "clm8t5u4q000008jq4qoc3031",
"role": "DAG_VIEWER",
"dagId": "my_dag",
"dagTag": "team-a"
}
],
"deploymentRoles": [
{
"deploymentId": "clm8t5u4q000008jq4qoc3031",
"role": "DEPLOYMENT_ADMIN"
}
],
"workspaceRoles": [
{
"role": "WORKSPACE_MEMBER",
"workspaceId": "clm8t5u4q000008jq4qoc3036"
}
]
}
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({
organizationRole: 'ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER',
dagRoles: [
{
deploymentId: 'clm8t5u4q000008jq4qoc3031',
role: 'DAG_VIEWER',
dagId: 'my_dag',
dagTag: 'team-a'
}
],
deploymentRoles: [{deploymentId: 'clm8t5u4q000008jq4qoc3031', role: 'DEPLOYMENT_ADMIN'}],
workspaceRoles: [{role: 'WORKSPACE_MEMBER', workspaceId: 'clm8t5u4q000008jq4qoc3036'}]
})
};
fetch('https://api.astronomer.io/iam/v1beta1/organizations/{organizationId}/teams/{teamId}/roles', 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/iam/v1beta1/organizations/{organizationId}/teams/{teamId}/roles",
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([
'organizationRole' => 'ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER',
'dagRoles' => [
[
'deploymentId' => 'clm8t5u4q000008jq4qoc3031',
'role' => 'DAG_VIEWER',
'dagId' => 'my_dag',
'dagTag' => 'team-a'
]
],
'deploymentRoles' => [
[
'deploymentId' => 'clm8t5u4q000008jq4qoc3031',
'role' => 'DEPLOYMENT_ADMIN'
]
],
'workspaceRoles' => [
[
'role' => 'WORKSPACE_MEMBER',
'workspaceId' => 'clm8t5u4q000008jq4qoc3036'
]
]
]),
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/iam/v1beta1/organizations/{organizationId}/teams/{teamId}/roles"
payload := strings.NewReader("{\n \"organizationRole\": \"ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER\",\n \"dagRoles\": [\n {\n \"deploymentId\": \"clm8t5u4q000008jq4qoc3031\",\n \"role\": \"DAG_VIEWER\",\n \"dagId\": \"my_dag\",\n \"dagTag\": \"team-a\"\n }\n ],\n \"deploymentRoles\": [\n {\n \"deploymentId\": \"clm8t5u4q000008jq4qoc3031\",\n \"role\": \"DEPLOYMENT_ADMIN\"\n }\n ],\n \"workspaceRoles\": [\n {\n \"role\": \"WORKSPACE_MEMBER\",\n \"workspaceId\": \"clm8t5u4q000008jq4qoc3036\"\n }\n ]\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/iam/v1beta1/organizations/{organizationId}/teams/{teamId}/roles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"organizationRole\": \"ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER\",\n \"dagRoles\": [\n {\n \"deploymentId\": \"clm8t5u4q000008jq4qoc3031\",\n \"role\": \"DAG_VIEWER\",\n \"dagId\": \"my_dag\",\n \"dagTag\": \"team-a\"\n }\n ],\n \"deploymentRoles\": [\n {\n \"deploymentId\": \"clm8t5u4q000008jq4qoc3031\",\n \"role\": \"DEPLOYMENT_ADMIN\"\n }\n ],\n \"workspaceRoles\": [\n {\n \"role\": \"WORKSPACE_MEMBER\",\n \"workspaceId\": \"clm8t5u4q000008jq4qoc3036\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/iam/v1beta1/organizations/{organizationId}/teams/{teamId}/roles")
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 \"organizationRole\": \"ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER\",\n \"dagRoles\": [\n {\n \"deploymentId\": \"clm8t5u4q000008jq4qoc3031\",\n \"role\": \"DAG_VIEWER\",\n \"dagId\": \"my_dag\",\n \"dagTag\": \"team-a\"\n }\n ],\n \"deploymentRoles\": [\n {\n \"deploymentId\": \"clm8t5u4q000008jq4qoc3031\",\n \"role\": \"DEPLOYMENT_ADMIN\"\n }\n ],\n \"workspaceRoles\": [\n {\n \"role\": \"WORKSPACE_MEMBER\",\n \"workspaceId\": \"clm8t5u4q000008jq4qoc3036\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"dagRoles": [
{
"deploymentId": "clm8t5u4q000008jq4qoc3031",
"role": "DAG_VIEWER",
"dagId": "my_dag",
"dagTag": "team-a"
}
],
"deploymentRoles": [
{
"deploymentId": "clm8t5u4q000008jq4qoc3031",
"role": "DEPLOYMENT_ADMIN"
}
],
"organizationRole": "ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER",
"workspaceRoles": [
{
"role": "WORKSPACE_MEMBER",
"workspaceId": "clm8t5u4q000008jq4qoc3036"
}
]
}{
"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
}Update Team roles
Update Organization and Workspace roles for a Team.
curl --request POST \
--url https://api.astronomer.io/iam/v1beta1/organizations/{organizationId}/teams/{teamId}/roles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"organizationRole": "ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER",
"dagRoles": [
{
"deploymentId": "clm8t5u4q000008jq4qoc3031",
"role": "DAG_VIEWER",
"dagId": "my_dag",
"dagTag": "team-a"
}
],
"deploymentRoles": [
{
"deploymentId": "clm8t5u4q000008jq4qoc3031",
"role": "DEPLOYMENT_ADMIN"
}
],
"workspaceRoles": [
{
"role": "WORKSPACE_MEMBER",
"workspaceId": "clm8t5u4q000008jq4qoc3036"
}
]
}
'import requests
url = "https://api.astronomer.io/iam/v1beta1/organizations/{organizationId}/teams/{teamId}/roles"
payload = {
"organizationRole": "ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER",
"dagRoles": [
{
"deploymentId": "clm8t5u4q000008jq4qoc3031",
"role": "DAG_VIEWER",
"dagId": "my_dag",
"dagTag": "team-a"
}
],
"deploymentRoles": [
{
"deploymentId": "clm8t5u4q000008jq4qoc3031",
"role": "DEPLOYMENT_ADMIN"
}
],
"workspaceRoles": [
{
"role": "WORKSPACE_MEMBER",
"workspaceId": "clm8t5u4q000008jq4qoc3036"
}
]
}
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({
organizationRole: 'ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER',
dagRoles: [
{
deploymentId: 'clm8t5u4q000008jq4qoc3031',
role: 'DAG_VIEWER',
dagId: 'my_dag',
dagTag: 'team-a'
}
],
deploymentRoles: [{deploymentId: 'clm8t5u4q000008jq4qoc3031', role: 'DEPLOYMENT_ADMIN'}],
workspaceRoles: [{role: 'WORKSPACE_MEMBER', workspaceId: 'clm8t5u4q000008jq4qoc3036'}]
})
};
fetch('https://api.astronomer.io/iam/v1beta1/organizations/{organizationId}/teams/{teamId}/roles', 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/iam/v1beta1/organizations/{organizationId}/teams/{teamId}/roles",
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([
'organizationRole' => 'ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER',
'dagRoles' => [
[
'deploymentId' => 'clm8t5u4q000008jq4qoc3031',
'role' => 'DAG_VIEWER',
'dagId' => 'my_dag',
'dagTag' => 'team-a'
]
],
'deploymentRoles' => [
[
'deploymentId' => 'clm8t5u4q000008jq4qoc3031',
'role' => 'DEPLOYMENT_ADMIN'
]
],
'workspaceRoles' => [
[
'role' => 'WORKSPACE_MEMBER',
'workspaceId' => 'clm8t5u4q000008jq4qoc3036'
]
]
]),
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/iam/v1beta1/organizations/{organizationId}/teams/{teamId}/roles"
payload := strings.NewReader("{\n \"organizationRole\": \"ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER\",\n \"dagRoles\": [\n {\n \"deploymentId\": \"clm8t5u4q000008jq4qoc3031\",\n \"role\": \"DAG_VIEWER\",\n \"dagId\": \"my_dag\",\n \"dagTag\": \"team-a\"\n }\n ],\n \"deploymentRoles\": [\n {\n \"deploymentId\": \"clm8t5u4q000008jq4qoc3031\",\n \"role\": \"DEPLOYMENT_ADMIN\"\n }\n ],\n \"workspaceRoles\": [\n {\n \"role\": \"WORKSPACE_MEMBER\",\n \"workspaceId\": \"clm8t5u4q000008jq4qoc3036\"\n }\n ]\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/iam/v1beta1/organizations/{organizationId}/teams/{teamId}/roles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"organizationRole\": \"ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER\",\n \"dagRoles\": [\n {\n \"deploymentId\": \"clm8t5u4q000008jq4qoc3031\",\n \"role\": \"DAG_VIEWER\",\n \"dagId\": \"my_dag\",\n \"dagTag\": \"team-a\"\n }\n ],\n \"deploymentRoles\": [\n {\n \"deploymentId\": \"clm8t5u4q000008jq4qoc3031\",\n \"role\": \"DEPLOYMENT_ADMIN\"\n }\n ],\n \"workspaceRoles\": [\n {\n \"role\": \"WORKSPACE_MEMBER\",\n \"workspaceId\": \"clm8t5u4q000008jq4qoc3036\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/iam/v1beta1/organizations/{organizationId}/teams/{teamId}/roles")
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 \"organizationRole\": \"ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER\",\n \"dagRoles\": [\n {\n \"deploymentId\": \"clm8t5u4q000008jq4qoc3031\",\n \"role\": \"DAG_VIEWER\",\n \"dagId\": \"my_dag\",\n \"dagTag\": \"team-a\"\n }\n ],\n \"deploymentRoles\": [\n {\n \"deploymentId\": \"clm8t5u4q000008jq4qoc3031\",\n \"role\": \"DEPLOYMENT_ADMIN\"\n }\n ],\n \"workspaceRoles\": [\n {\n \"role\": \"WORKSPACE_MEMBER\",\n \"workspaceId\": \"clm8t5u4q000008jq4qoc3036\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"dagRoles": [
{
"deploymentId": "clm8t5u4q000008jq4qoc3031",
"role": "DAG_VIEWER",
"dagId": "my_dag",
"dagTag": "team-a"
}
],
"deploymentRoles": [
{
"deploymentId": "clm8t5u4q000008jq4qoc3031",
"role": "DEPLOYMENT_ADMIN"
}
],
"organizationRole": "ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER",
"workspaceRoles": [
{
"role": "WORKSPACE_MEMBER",
"workspaceId": "clm8t5u4q000008jq4qoc3036"
}
]
}{
"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 Team belongs.
The ID of the Team to update roles for.
Body
The request body for updating the Team's roles
The Team's Organization roles.
"ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER"
The Team's updated DAG roles.
Show child attributes
Show child attributes
The user's updated Deployment roles. The Deployments you specify must belong to the Team's Organization.
Show child attributes
Show child attributes
The Team's updated Workspace roles. The Workspaces you specify must belong to the Team's Organization.
Show child attributes
Show child attributes
Response
OK
A list of the subject's DAG roles.
Show child attributes
Show child attributes
A list of the subject's Deployment roles. Currently only for API tokens.
Show child attributes
Show child attributes
The subject's Organization role.
"ORGANIZATION_OWNER,ORGANIZATION_OBSERVE_ADMIN,ORGANIZATION_OBSERVE_MEMBER,ORGANIZATION_BILLING_ADMIN,ORGANIZATION_MEMBER"
A list of the subject's Workspace roles.
Show child attributes
Show child attributes
Was this page helpful?