Get authenticated caller identity
curl --request GET \
--url https://api.cloneable.ai/auth/whoami \
--header 'x-api-key: <api-key>'import requests
url = "https://api.cloneable.ai/auth/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://api.cloneable.ai/auth/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://api.cloneable.ai/auth/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://api.cloneable.ai/auth/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://api.cloneable.ai/auth/whoami")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloneable.ai/auth/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{
"user_id": "66f1a2b3c4d5e6f708192a3b",
"member_id": "member-live-11111111-2222-3333-4444-555555555555",
"email": "ops@example.com",
"company_id": "65a0b1c2d3e4f5061728394a",
"org_id": "organization-live-11111111-2222-3333-4444-555555555555",
"role": "stytch_admin"
}{
"message": "Invalid API Key"
}{
"message": "Invalid API Key"
}{
"message": "<string>"
}{
"message": "Invalid API Key"
}Authentication
Get authenticated caller identity
Verify your x-api-key credential and confirm the bound organization (company_id, org_id), user ID, and effective role before reading or writing data. Recommended as your first test call in the Playground.
GET
/
auth
/
whoami
Get authenticated caller identity
curl --request GET \
--url https://api.cloneable.ai/auth/whoami \
--header 'x-api-key: <api-key>'import requests
url = "https://api.cloneable.ai/auth/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://api.cloneable.ai/auth/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://api.cloneable.ai/auth/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://api.cloneable.ai/auth/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://api.cloneable.ai/auth/whoami")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cloneable.ai/auth/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{
"user_id": "66f1a2b3c4d5e6f708192a3b",
"member_id": "member-live-11111111-2222-3333-4444-555555555555",
"email": "ops@example.com",
"company_id": "65a0b1c2d3e4f5061728394a",
"org_id": "organization-live-11111111-2222-3333-4444-555555555555",
"role": "stytch_admin"
}{
"message": "Invalid API Key"
}{
"message": "Invalid API Key"
}{
"message": "<string>"
}{
"message": "Invalid API Key"
}