HTTP API
Who is calling
GET
/v1/me
const url = 'https://sergo.example.com/v1/me';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://sergo.example.com/v1/me \ --header 'Authorization: Bearer <token>'The key you called with: its type, its access and, for an agent key, its name. A quick way to check that a key works.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Successful Response
Media typeapplication/json
Me
object
user
required
The person, when called from a console session
Any of:
PublicUser
object
id
required
Id
string
username
required
Username
The username — it may be an email address
string
name
required
Name
The display name
string
role
required
Role
user or admin
string
password_change_required
required
Password Change Required
Signed in with a password someone else set — only the console can continue
boolean
null
key
required
The key, when called with a key
Any of:
KeyIdentity
object
type
required
Type
An agent key or a personal key
string
access
required
Access
read_write can also upload
string
masked
required
Masked
The key with most of it hidden, as the console shows it
string
null
Example
{ "user": { "password_change_required": false }, "key": { "type": "agent", "access": "read" }}