List teams for a user
curl --request GET \
--url https://api.astronomer.io/v1/organizations/{organizationId}/users/{userId}/teams \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.astronomer.io/v1/organizations/{organizationId}/users/{userId}/teams"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.astronomer.io/v1/organizations/{organizationId}/users/{userId}/teams', 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/v1/organizations/{organizationId}/users/{userId}/teams",
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://api.astronomer.io/v1/organizations/{organizationId}/users/{userId}/teams"
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://api.astronomer.io/v1/organizations/{organizationId}/users/{userId}/teams")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/v1/organizations/{organizationId}/users/{userId}/teams")
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{
"limit": 10,
"offset": 0,
"teams": [
{
"id": "clma5ftgk000008mhgev00k7d",
"isIdpManaged": false,
"name": "My Team",
"organizationRole": "ORGANIZATION_MEMBER",
"dagRoles": [
{
"deploymentId": "clm8t5u4q000008jq4qoc3031",
"role": "DAG_VIEWER",
"dagId": "my_dag",
"dagTag": "team-a"
}
],
"deploymentRoles": [
{
"deploymentId": "clm8t5u4q000008jq4qoc3031",
"role": "DEPLOYMENT_ADMIN"
}
],
"description": "My Team description",
"rolesCount": 1,
"workspaceRoles": [
{
"role": "WORKSPACE_MEMBER",
"workspaceId": "clm8t5u4q000008jq4qoc3036"
}
]
}
],
"totalCount": 100
}{
"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>"
}
]
}User
List teams for a user
List the teams a user belongs to within an Organization.
GET
/
organizations
/
{organizationId}
/
users
/
{userId}
/
teams
List teams for a user
curl --request GET \
--url https://api.astronomer.io/v1/organizations/{organizationId}/users/{userId}/teams \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.astronomer.io/v1/organizations/{organizationId}/users/{userId}/teams"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.astronomer.io/v1/organizations/{organizationId}/users/{userId}/teams', 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/v1/organizations/{organizationId}/users/{userId}/teams",
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://api.astronomer.io/v1/organizations/{organizationId}/users/{userId}/teams"
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://api.astronomer.io/v1/organizations/{organizationId}/users/{userId}/teams")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/v1/organizations/{organizationId}/users/{userId}/teams")
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{
"limit": 10,
"offset": 0,
"teams": [
{
"id": "clma5ftgk000008mhgev00k7d",
"isIdpManaged": false,
"name": "My Team",
"organizationRole": "ORGANIZATION_MEMBER",
"dagRoles": [
{
"deploymentId": "clm8t5u4q000008jq4qoc3031",
"role": "DAG_VIEWER",
"dagId": "my_dag",
"dagTag": "team-a"
}
],
"deploymentRoles": [
{
"deploymentId": "clm8t5u4q000008jq4qoc3031",
"role": "DEPLOYMENT_ADMIN"
}
],
"description": "My Team description",
"rolesCount": 1,
"workspaceRoles": [
{
"role": "WORKSPACE_MEMBER",
"workspaceId": "clm8t5u4q000008jq4qoc3036"
}
]
}
],
"totalCount": 100
}{
"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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the Organization.
The user's ID.
Query Parameters
Offset for pagination
Required range:
x >= 0Limit for pagination
Required range:
0 <= x <= 1000Sorting criteria, each criterion should conform to format 'fieldName:asc' or 'fieldName:desc'
Available options:
name:asc, name:desc, description:asc, description:desc, createdAt:asc, createdAt:desc, updatedAt:asc, updatedAt:desc Response
OK
Was this page helpful?
⌘I