Get the authenticated caller
curl --request GET \
--url https://albus.sh/api/whoami \
--header 'Authorization: Bearer <token>'import requests
url = "https://albus.sh/api/whoami"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://albus.sh/api/whoami', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"user": {
"user_id": "user_123",
"email": "user@example.com",
"organizations": [
{
"id": "42",
"name": "Acme Corp",
"roles": [
"admin"
]
}
],
"name": "John Doe",
"roles": [
"admin"
],
"active_organization": {
"id": "42",
"name": "Acme Corp",
"roles": [
"admin"
]
},
"issued_at": 123,
"expires_at": 123
},
"api_key": {
"name": "<string>",
"organization_id": "42"
}
}{
"message": "Invalid or expired token"
}Auth
Get the authenticated caller
Returns the caller a credential authenticates: a signed-in user with every organization they belong to and their roles in each, or the API key that signed the request, along with the organization it acts in.
GET
/
whoami
Get the authenticated caller
curl --request GET \
--url https://albus.sh/api/whoami \
--header 'Authorization: Bearer <token>'import requests
url = "https://albus.sh/api/whoami"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://albus.sh/api/whoami', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"user": {
"user_id": "user_123",
"email": "user@example.com",
"organizations": [
{
"id": "42",
"name": "Acme Corp",
"roles": [
"admin"
]
}
],
"name": "John Doe",
"roles": [
"admin"
],
"active_organization": {
"id": "42",
"name": "Acme Corp",
"roles": [
"admin"
]
},
"issued_at": 123,
"expires_at": 123
},
"api_key": {
"name": "<string>",
"organization_id": "42"
}
}{
"message": "Invalid or expired token"
}Authorizations
bearerAuthapiKey
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.