List roles
curl --request GET \
--url https://api.astronomer.io/v1/organizations/{organizationId}/roles \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.astronomer.io/v1/organizations/{organizationId}/roles"
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}/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/v1/organizations/{organizationId}/roles",
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}/roles"
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}/roles")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/v1/organizations/{organizationId}/roles")
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": 1,
"offset": 1,
"roles": [
{
"createdAt": "2022-11-22T04:37:12Z",
"createdBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
},
"id": "cluc9tapx000901qn2xrgqdmn",
"name": "Deployment_Viewer",
"restrictedWorkspaceIds": [
"cldbvzoi20182g8odxt8ehi5i"
],
"scopeType": "DEPLOYMENT",
"updatedAt": "2022-11-22T04:37:12Z",
"updatedBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
},
"description": "Subject can only view deployments."
}
],
"totalCount": 1,
"defaultRoles": [
{
"name": "Deployment_Viewer",
"permissions": [
"deployment.get"
],
"scopeType": "DEPLOYMENT",
"description": "Subject can only view deployments."
}
]
}{
"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>"
}
]
}Role
List roles
List available user roles in an Organization.
GET
/
organizations
/
{organizationId}
/
roles
List roles
curl --request GET \
--url https://api.astronomer.io/v1/organizations/{organizationId}/roles \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.astronomer.io/v1/organizations/{organizationId}/roles"
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}/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/v1/organizations/{organizationId}/roles",
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}/roles"
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}/roles")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/v1/organizations/{organizationId}/roles")
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": 1,
"offset": 1,
"roles": [
{
"createdAt": "2022-11-22T04:37:12Z",
"createdBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
},
"id": "cluc9tapx000901qn2xrgqdmn",
"name": "Deployment_Viewer",
"restrictedWorkspaceIds": [
"cldbvzoi20182g8odxt8ehi5i"
],
"scopeType": "DEPLOYMENT",
"updatedAt": "2022-11-22T04:37:12Z",
"updatedBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
},
"description": "Subject can only view deployments."
}
],
"totalCount": 1,
"defaultRoles": [
{
"name": "Deployment_Viewer",
"permissions": [
"deployment.get"
],
"scopeType": "DEPLOYMENT",
"description": "Subject can only view deployments."
}
]
}{
"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 Organization's ID.
Query Parameters
Whether to include default Astro roles in the returned list.
Filter the list of roles based on the scope of each role.
Available options:
DEPLOYMENT, WORKSPACE, ORGANIZATION, DAG Offset for pagination.
Required range:
x >= 0Limit for pagination.
Required range:
x >= 0Sorting criteria, each criterion should conform to format 'fieldName:asc' or 'fieldName:desc'.
Available options:
name:asc, name:desc, scopeType:asc, scopeType:desc, description:asc, description:desc, createdAt:asc, createdAt:desc, updatedAt:asc, updatedAt:desc Response
OK
The number of custom roles returned.
Example:
1
The offset of the custom roles.
Example:
1
The list of custom roles.
Show child attributes
Show child attributes
The total number of custom roles.
Example:
1
The list of default roles.
Show child attributes
Show child attributes
Was this page helpful?
⌘I