List Agent API Tokens
List Agent API Tokens.
GET
/
organizations
/
{organizationId}
/
deployments
/
{deploymentId}
/
agent-tokens
List Agent API Tokens
curl --request GET \
--url https://api.astronomer.io/iam/v1beta1/organizations/{organizationId}/deployments/{deploymentId}/agent-tokens \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.astronomer.io/iam/v1beta1/organizations/{organizationId}/deployments/{deploymentId}/agent-tokens"
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/iam/v1beta1/organizations/{organizationId}/deployments/{deploymentId}/agent-tokens', 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}/deployments/{deploymentId}/agent-tokens",
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/iam/v1beta1/organizations/{organizationId}/deployments/{deploymentId}/agent-tokens"
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/iam/v1beta1/organizations/{organizationId}/deployments/{deploymentId}/agent-tokens")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/iam/v1beta1/organizations/{organizationId}/deployments/{deploymentId}/agent-tokens")
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,
"tokens": [
{
"createdAt": "2022-11-22T04:37:12Z",
"description": "my token description",
"id": "clm8q7f6q000008lcgyougpsk",
"kind": "STANDARD",
"name": "My token",
"shortToken": "short-token",
"startAt": "2022-11-22T04:37:12Z",
"type": "WORKSPACE",
"updatedAt": "2022-11-22T04:37:12Z",
"createdBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
},
"endAt": "2022-11-22T04:37:12Z",
"expiryPeriodInDays": 30,
"lastRotatedAt": "2022-11-22T04:37:12Z",
"lastUsedAt": "2022-11-22T04:37:12Z",
"roles": [
{
"entityId": "clm8sgvai000008l794psbkdv",
"entityType": "WORKSPACE",
"role": "WORKSPACE_MEMBER",
"deploymentId": "clm8t5u4q000008jq4qoc3031"
}
],
"token": "token",
"updatedBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
}
}
],
"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
Path Parameters
Query Parameters
A list of field names to sort by, and whether to show results as ascending or descending. Formatted as <fieldName>:asc or <fieldName>:desc.
Available options:
name:asc, name:desc, description:asc, description:desc, createdAt:asc, createdAt:desc, updatedAt:asc, updatedAt:desc, createdById:asc, createdById:desc, updatedById:asc, updatedById:desc, tokenStartAt:asc, tokenStartAt:desc Was this page helpful?
⌘I
List Agent API Tokens
curl --request GET \
--url https://api.astronomer.io/iam/v1beta1/organizations/{organizationId}/deployments/{deploymentId}/agent-tokens \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.astronomer.io/iam/v1beta1/organizations/{organizationId}/deployments/{deploymentId}/agent-tokens"
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/iam/v1beta1/organizations/{organizationId}/deployments/{deploymentId}/agent-tokens', 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}/deployments/{deploymentId}/agent-tokens",
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/iam/v1beta1/organizations/{organizationId}/deployments/{deploymentId}/agent-tokens"
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/iam/v1beta1/organizations/{organizationId}/deployments/{deploymentId}/agent-tokens")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/iam/v1beta1/organizations/{organizationId}/deployments/{deploymentId}/agent-tokens")
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,
"tokens": [
{
"createdAt": "2022-11-22T04:37:12Z",
"description": "my token description",
"id": "clm8q7f6q000008lcgyougpsk",
"kind": "STANDARD",
"name": "My token",
"shortToken": "short-token",
"startAt": "2022-11-22T04:37:12Z",
"type": "WORKSPACE",
"updatedAt": "2022-11-22T04:37:12Z",
"createdBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
},
"endAt": "2022-11-22T04:37:12Z",
"expiryPeriodInDays": 30,
"lastRotatedAt": "2022-11-22T04:37:12Z",
"lastUsedAt": "2022-11-22T04:37:12Z",
"roles": [
{
"entityId": "clm8sgvai000008l794psbkdv",
"entityType": "WORKSPACE",
"role": "WORKSPACE_MEMBER",
"deploymentId": "clm8t5u4q000008jq4qoc3031"
}
],
"token": "token",
"updatedBy": {
"id": "clm8qv74h000008mlf08scq7k",
"apiTokenName": "my-token",
"avatarUrl": "https://avatar.url",
"fullName": "Jane Doe",
"subjectType": "USER",
"username": "user1@company.com"
}
}
],
"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>"
}
]
}