Who the caller is signed in as, and what they can act on.
GET
/auth/me
curl --request GET \ --url http://localhost:3001/auth/me \ --header 'Authorization: Bearer <token>'import requests
url = "http://localhost:3001/auth/me"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.json())use reqwest;
#[tokio::main]pub async fn main() { let url = "http://localhost:3001/auth/me";
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap());
let client = reqwest::Client::new(); let response = client.get(url) .headers(headers) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}Reuses handlers::list_portfolios’s exact query shape rather than a
widened or narrowed one, so /auth/me’s notion of “granted portfolios”
can never drift from /portfolios’s.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”OK
Media typeapplication/json
The signed-in principal plus its granted portfolios — the shape a front end needs to render itself without a second round trip.
object
code
required
string
display_name
string
portfolios
required
Array<object>
One portfolio the caller is entitled to, with the entitlement itself.
The flags are returned rather than filtered on, so a client can grey out what it cannot do instead of discovering it from a 403 mid-order.
object
base_currency
string
can_allocate
required
boolean
can_trade
required
boolean
can_view
required
boolean
code
required
string
name
required
string
portfolio_id
required
string
status
required
string
principal_id
required
string
Example generated
{ "code": "example", "display_name": "example", "portfolios": [ { "base_currency": "example", "can_allocate": true, "can_trade": true, "can_view": true, "code": "example", "name": "example", "portfolio_id": "example", "status": "example" } ], "principal_id": "example"}Not authenticated