Get current user
curl --request GET \
--url https://api.astronomer.io/v1/users/self \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.astronomer.io/v1/users/self"
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/users/self', 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/users/self",
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/users/self"
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/users/self")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/v1/users/self")
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{
"avatarUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"fullName": "<string>",
"id": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"username": "<string>",
"featureFlags": [
{
"key": "<string>",
"value": true
}
],
"invites": [
{
"expiresAt": "2023-11-07T05:31:56Z",
"inviteId": "<string>",
"organizationId": "<string>"
}
],
"isIdpManaged": true,
"organizationId": "<string>",
"roles": [
{
"role": "<string>",
"scope": {
"entityId": "<string>",
"type": "<string>",
"dagTag": "<string>",
"deploymentId": "<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
Get current user
Get the authenticated user’s profile and roles.
GET
/
users
/
self
Get current user
curl --request GET \
--url https://api.astronomer.io/v1/users/self \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.astronomer.io/v1/users/self"
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/users/self', 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/users/self",
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/users/self"
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/users/self")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.astronomer.io/v1/users/self")
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{
"avatarUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"fullName": "<string>",
"id": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"username": "<string>",
"featureFlags": [
{
"key": "<string>",
"value": true
}
],
"invites": [
{
"expiresAt": "2023-11-07T05:31:56Z",
"inviteId": "<string>",
"organizationId": "<string>"
}
],
"isIdpManaged": true,
"organizationId": "<string>",
"roles": [
{
"role": "<string>",
"scope": {
"entityId": "<string>",
"type": "<string>",
"dagTag": "<string>",
"deploymentId": "<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.
Query Parameters
Create the user if they don't already exist.
Response
OK
The URL for the user's profile image.
The time when the user was created.
The user's full name.
The user's ID.
The user's status.
Available options:
ACTIVE, INACTIVE, PENDING, BANNED The time when the user was last updated.
The user's username.
The user's feature flags.
Show child attributes
Show child attributes
The user's pending Organization invites.
Show child attributes
Show child attributes
Whether the user is managed by an identity provider.
The user's primary Organization ID.
The user's roles across all scopes.
Show child attributes
Show child attributes
Was this page helpful?
⌘I