E002: Get user
GET /api/user
Returns the authenticated user's profile, their active-org context, and the list of every org they belong to. Triggered on app load. The L4 boundary uses the response to pick (or confirm) an active org via the X-Org-Id header on every subsequent request.
Authentication
User-scoped route. Requires Authorization: Bearer <firebase-id-token>; X-Org-Id is not required — the user identity alone is sufficient. Access: Member.
Request
No body. X-Org-Id selects the active org context if the user belongs to more than one; if absent, falls back to the user's oldest membership.
Response — 200 OK
{
"user": {
"id": "uuid",
"orgId": "uuid",
"firebaseUid": "string",
"email": "user@example.com",
"displayName": "Jane Doe",
"role": "admin",
"organizations": [
{ "id": "uuid", "name": "Acme Co", "slug": "acme-co", "branding": { ... } }
]
}
}
Cache-Control: no-store, no-cache, must-revalidate, private is set on the response.
Errors
| HTTP | code | Condition |
|---|---|---|
| 404 | not_found | No users row exists for the verified Firebase identity in the requested org. |
Workflow
Calls W002 Get user.