Account API
Account endpoints work with current user, metadata, avatar, and selected workspace.
All Account endpoints except POST /api/token require Authorization: Bearer <token>.
POST /api/token
POST /api/token does not require an existing Authorization: Bearer <token> header. The provider-specific credentials authenticate the identity through the selected app.
Every successful request creates a fresh persistent Bearer token; it does not reuse or return an earlier token. On the first successful login for an identity, the service may also create an account and workspace.
Arguments: no path/query arguments.
Payload:
| Field | Required | Description |
|---|---|---|
app | Yes | Auth app/provider name. |
credentials | Yes | Provider-specific credentials object. |
Response: TokenResponse.
Example request (the missing Authorization header is intentional):
POST /api/token
Content-Type: application/json
{
"app": "google",
"credentials": {
"credential": "<provider-issued-credential>"
}
}Example response:
{
"token": "<new-bearer-token>"
}Provider credentials and the returned token are secrets. Send them only over HTTPS; never log, publish, or commit them.
GET /api/me
Returns current account, identity, tier, memberships, and selected workspace.
Arguments: none.
Payload: none.
Response: Me.
DELETE /api/me
Deletes current account.
Arguments: none.
Payload: none.
Response: OperationResult.
PUT /api/me/meta
Updates user metadata.
Arguments: none.
Payload:
| Field | Required | Description |
|---|---|---|
nickname | Yes | User display name, 2-80 characters. Leading and trailing whitespace is trimmed before the value is saved and returned. |
Response: HTTP 200 OK.
| Field | Required | Description |
|---|---|---|
nickname | Yes | Trimmed nickname that was saved. |
POST /api/me/avatar
Uploads current account avatar.
Arguments: none.
Payload:
| Field | Required | Description |
|---|---|---|
filename | Yes | Original filename. |
contentType | Yes | Image MIME type. |
data | Yes | Base64 image data. |
Response: AvatarUploadResult.
GET /api/me/workspace
Returns selected workspace of current account.
Arguments: none.
Payload: none.
Response: CurrentWorkspaceResponse.
PUT /api/me/workspace
Changes selected workspace of current account.
Arguments: none.
Payload:
| Field | Required | Description |
|---|---|---|
workspace | Yes | Workspace fullname or null to reset selection. |
Response: CurrentWorkspaceResponse.
GET /api/account/settings
Returns account settings.
Arguments: none.
Payload: none.
Response: AccountSettings.
PUT /api/account/settings
Saves account settings.
Arguments: none.
Payload: settings object. The concrete set of fields depends on the current account settings UI version.
Response: AccountSettings.