Who is acting, in which organization, with which role
curl --request GET \
--url https://app.trustivan.com/api/v1/me/context \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/me/context"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trustivan.com/api/v1/me/context', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/me/context"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"permissions": [
"<string>"
],
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>",
"name": "<string>"
},
"organization": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>"
},
"role": "owner",
"features": {
"nhi_security": true
},
"brand": {
"custom": true,
"product_name": "<string>",
"white_label": true,
"logo_url": "<string>",
"colors": {
"primary": "<string>",
"primary_dark": "<string>",
"on_primary": "<string>",
"accent": "<string>",
"accent_dark": "<string>",
"on_accent": "<string>"
},
"support_email": "<string>",
"support_url": "<string>"
}
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Who is acting, in which organization, with which role
The identity contract with NHI Security; see
docs/architecture/44-nhi-security-integration.md. NHI forwards the
caller’s trustivan_session cookie here and believes the answer, so
revocation, disabled users and the per-user session cutoff are decided
by this endpoint’s authenticator and nowhere else.
organization is the organization the session acts in: the one the
user selected with PUT /me/active-org while they are still a member
of it, otherwise the oldest organization they belong to. role is
their role there. features carries only the flags NHI needs; it is
not a copy of /billing/entitlements.
Human sessions only. Every response carries Cache-Control: no-store.
GET
/
me
/
context
Who is acting, in which organization, with which role
curl --request GET \
--url https://app.trustivan.com/api/v1/me/context \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.trustivan.com/api/v1/me/context"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.trustivan.com/api/v1/me/context', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/me/context"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"permissions": [
"<string>"
],
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "<string>",
"name": "<string>"
},
"organization": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"slug": "<string>"
},
"role": "owner",
"features": {
"nhi_security": true
},
"brand": {
"custom": true,
"product_name": "<string>",
"white_label": true,
"logo_url": "<string>",
"colors": {
"primary": "<string>",
"primary_dark": "<string>",
"on_primary": "<string>",
"accent": "<string>",
"accent_dark": "<string>",
"on_accent": "<string>"
},
"support_email": "<string>",
"support_url": "<string>"
}
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Authorizations
Response
The caller's session context.