GET /v1/auth/session
Returns the signed-in user, the active organization and project, the user's organizations and the CSRF token to send as `x-b3os-csrf` on writes.

Authentication

API Key (cookie: __Host-b3os_session)

Responses

200 The session.
application/json
object string REQUIRED
Enum: auth_session
user object REQUIRED
id string REQUIRED
email string (email) REQUIRED
name string | null REQUIRED
image_url string (uri) | null REQUIRED
org object | null REQUIRED
The active organization, or `null` before the user has one.
id string REQUIRED
object string REQUIRED
Enum: organization
name string REQUIRED
slug string REQUIRED
role string | null REQUIRED
The caller's role; `null` for API keys.
Enum: owner, admin, member, null
plan string REQUIRED
Enum: beta
created_at string (date-time) REQUIRED
metadata object REQUIRED
Up to 16 string key-value pairs you attach to an object for your own use. Keys are 1 to 40 characters of `A-Z a-z 0-9 _ . : -`; values are at most 500 characters. B3OS never interprets them.
project object | null REQUIRED
The active project, or `null`.
id string REQUIRED
object string REQUIRED
Enum: project
org_id string REQUIRED
name string REQUIRED
created_at string (date-time) REQUIRED
updated_at string (date-time) REQUIRED
metadata object REQUIRED
Up to 16 string key-value pairs you attach to an object for your own use. Keys are 1 to 40 characters of `A-Z a-z 0-9 _ . : -`; values are at most 500 characters. B3OS never interprets them.
orgs object[] REQUIRED
Array of:
id string REQUIRED
name string REQUIRED
role string REQUIRED
Enum: owner, admin, member
needs_invite boolean REQUIRED
`true` until the user belongs to an organization (redeem an invite code).
csrf_token string REQUIRED
Send as `x-b3os-csrf` on every cookie-authenticated write.
expires_at string (date-time) REQUIRED
401 Missing, malformed, expired or revoked credentials (`unauthorized`).
403 Authenticated but not allowed (`forbidden`, `egress_denied`).
429 A rate, concurrency or quota limit applies (`rate_limited`, `concurrency_limited`, `quota_exceeded`).
500 Something failed inside B3OS (`internal`). Retry with backoff.
503 The node or the product is not available right now (`node_unavailable`, `product_unavailable`, `capacity_unavailable`).
curl -X GET 'https://beta.b3os.org/v1/auth/session' \  -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://beta.b3os.org/v1/auth/session', {  method: 'GET',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN"  }});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.get('https://beta.b3os.org/v1/auth/session', headers=headers)print(response.json())
200 Response
{  "object": "auth_session",  "user": {    "id": "usr_01m5t3jv4b5sappg7vzv1rwx6x",    "email": "dev@example.com",    "name": "Dana Dev",    "image_url": "https://avatars.githubusercontent.com/u/1?v=4"  },  "org": {    "id": "org_01m5t5hthd29mm5wpza5ndd6mm",    "object": "organization",    "name": "Acme",    "slug": "acme",    "role": "owner",    "plan": "beta",    "created_at": "2026-10-20T16:00:00.000Z",    "metadata": {}  },  "project": {    "id": "prj_01m5t3pf8heewxt65ej3dm577y",    "object": "project",    "org_id": "org_01m5t5hthd29mm5wpza5ndd6mm",    "name": "default",    "created_at": "2026-10-20T16:00:00.000Z",    "updated_at": "2026-10-20T16:00:00.000Z",    "metadata": {}  },  "orgs": [    {      "id": "org_01m5t5hthd29mm5wpza5ndd6mm",      "name": "Acme",      "role": "owner"    }  ],  "needs_invite": false,  "csrf_token": "9f8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d",  "expires_at": "2026-11-24T22:10:00.000Z"}
Ask a question... ⌘I