Thread

SA
Saif Ali Shaik9:39 AMOpen in Slack
Is there a way (a API) that where I can get the current logged in user details? such as email address? or any identifier?

2 replies
J(
joey (archestra team)10:55 AMOpen in Slack
so for getting the current logged-in user's details, there's two auth methods — here's what works with each:
Option 1: Cookie-based (browser sessions)
No special headers needed — the browser sends session cookies automatically. Returns:
{
  "session": {
    "userId": "...",
    "activeOrganizationId": "..."
  },
  "user": {
    "id": "...",
    "email": "<mailto:user@example.com|user@example.com>",
    "name": "Jane Doe",
    "role": "admin",
    "emailVerified": true
  }
}```
*Option 2: API key*
API keys use the header format `Authorization: archestra_<key>`

Currently there isn't a dedicated "get my user info" endpoint that works with API keys. The `/api/auth/get-session` endpoint only recognizes cookie sessions

There is the  `GET /api/user/permissions` endpoint, which will return your RBAC permissions (but not email/name)
1
J(
joey (archestra team)10:55 AMOpen in Slack
for your hackathon project, if you need an endpoint that doesn't yet exist, feel free to build that out!