Who am I
curl --request GET \
--url https://odyssey.asteroid.ai/users/v2/whoami \
--header 'X-Api-Key: <api-key>'import requests
url = "https://odyssey.asteroid.ai/users/v2/whoami"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://odyssey.asteroid.ai/users/v2/whoami', 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://odyssey.asteroid.ai/users/v2/whoami",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$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://odyssey.asteroid.ai/users/v2/whoami"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://odyssey.asteroid.ai/users/v2/whoami")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://odyssey.asteroid.ai/users/v2/whoami")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"credential": "jwt",
"id": "<string>",
"kind": "person",
"apiKeyId": "<string>",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"person": {
"email": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"code": 400,
"message": "<string>",
"detail": "<string>",
"errors": [
{
"detail": "<string>",
"parameter": "<string>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": 401,
"message": "<string>",
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": 403,
"message": "<string>",
"capability": "<string>",
"detail": "<string>",
"instance": "<string>",
"reason": "capability_required",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": 404,
"message": "<string>",
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": 500,
"message": "<string>",
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}Context
Who am I
Returns who the request acts as and for which organization. Works for every credential: a sign-in token, a user-scoped key or an org key. Use it to check a key before you rely on it.
GET
/
users
/
v2
/
whoami
Who am I
curl --request GET \
--url https://odyssey.asteroid.ai/users/v2/whoami \
--header 'X-Api-Key: <api-key>'import requests
url = "https://odyssey.asteroid.ai/users/v2/whoami"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://odyssey.asteroid.ai/users/v2/whoami', 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://odyssey.asteroid.ai/users/v2/whoami",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$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://odyssey.asteroid.ai/users/v2/whoami"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://odyssey.asteroid.ai/users/v2/whoami")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://odyssey.asteroid.ai/users/v2/whoami")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"credential": "jwt",
"id": "<string>",
"kind": "person",
"apiKeyId": "<string>",
"organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"person": {
"email": "<string>",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"code": 400,
"message": "<string>",
"detail": "<string>",
"errors": [
{
"detail": "<string>",
"parameter": "<string>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": 401,
"message": "<string>",
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": 403,
"message": "<string>",
"capability": "<string>",
"detail": "<string>",
"instance": "<string>",
"reason": "capability_required",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": 404,
"message": "<string>",
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": 500,
"message": "<string>",
"detail": "<string>",
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}Authorizations
ApiKeyAuthBearerAuth
Response
The request has succeeded.
Who is calling, and for which organization
The credential that authenticated the request
Available options:
jwt, user_api_key, org_api_key The person's id, the key's id, or the service's name
The kind of caller a request acts as
Available options:
person, api_key, service The user-scoped key that authenticated the request, when one did. An org key's id is id.
The one organization the request acts in. Absent when the caller spans several organizations: a sign-in to several, or a user-scoped key not yet pinned to one.
The person a request acts as. Absent for an org key or a service.
Show child attributes
Show child attributes

