Echo the authenticated admin's identity and roles
GET
/api/v1/admin/whoami
const url = 'https://api.aetherplatform.cloud/api/v1/admin/whoami';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.aetherplatform.cloud/api/v1/admin/whoami \ --header 'Authorization: Bearer <token>'Returns the calling admin’s email and Keycloak realm roles. Doubles as a liveness check that the platform-admin gate is wired correctly. Like the whole /api/v1/admin tree, this requires the platform-admin realm role and rejects API tokens (which carry no roles) with 403.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The authenticated admin’s identity.
Media typeapplication/json
object
email
required
The admin’s email, from the JWT email claim.
string
roles
required
Keycloak realm roles from realm_access.roles.
Array<string>
Examplegenerated
{ "email": "example", "roles": [ "example" ]}Missing or invalid credentials.
Media typeapplication/json
object
error
required
object
code
required
A stable, machine-readable error code.
string
message
required
string
details
Array<object>
object
field
required
string
code
required
string
message
required
string
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": [ { "field": "example", "code": "example", "message": "example" } ] }}The credential was accepted but lacks the required role or access (e.g. a non-platform-admin calling an /api/v1/admin endpoint).
Media typeapplication/json
object
error
required
object
code
required
A stable, machine-readable error code.
string
message
required
string
details
Array<object>
object
field
required
string
code
required
string
message
required
string
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": [ { "field": "example", "code": "example", "message": "example" } ] }}