GET /v1/auth/whoami
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <api-key> or OAuth access token |
Example Request
curl "https://api.monid.ai/v1/auth/whoami" \
-H "Authorization: Bearer monid_live_..."
const res = await fetch("https://api.monid.ai/v1/auth/whoami", {
headers: { Authorization: "Bearer monid_live_..." },
});
import requests
res = requests.get(
"https://api.monid.ai/v1/auth/whoami",
headers={"Authorization": "Bearer monid_live_..."},
)
200 OK
| Field | Type | Description |
|---|---|---|
user | object | The authenticated user |
user.userId | string | User identifier |
user.username | string | Username (may be empty) |
user.email | string | undefined | Primary email, when known |
user.metadata | object | Free-form user metadata |
user.createdAt | string | Record creation time (ISO 8601) |
user.updatedAt | string | Record last-update time (ISO 8601) |
workspace | object | undefined | The caller’s workspace — absent when the caller has none |
workspace.workspaceId | string | Workspace identifier |
workspace.name | string | Workspace display name (may be empty) |
workspace.slug | string | Workspace slug (may be empty) |
workspace.metadata | object | Free-form workspace metadata |
workspace.createdAt | string | Record creation time (ISO 8601) |
workspace.updatedAt | string | Record last-update time (ISO 8601) |
Example Response
{
"user": {
"userId": "user_abc123",
"username": "jane",
"email": "jane@acme.com",
"metadata": {},
"createdAt": "2026-01-15T09:00:00.000Z",
"updatedAt": "2026-03-01T12:00:00.000Z"
},
"workspace": {
"workspaceId": "org_abc123",
"name": "Acme, Inc.",
"slug": "acme-inc",
"metadata": {},
"createdAt": "2026-01-15T09:00:00.000Z",
"updatedAt": "2026-03-01T12:00:00.000Z"
}
}