/api/user

Get the currently logged in user, and perform actions on the current user.

Info

This endpoint requires authentication.

GET
Request

Get the currently authenticated user.

Response

Status: 200 OK

Content-Type: application/json

PropertyTypeDescription
userUserThe authenticated user object.
tokenstringThe user's token.

Example

{
"user": {
"id": "cmb6042f500029kenox2u8npu",
"username": "admin",
"createdAt": "2025-05-27T04:13:22.625Z",
"updatedAt": "2025-05-28T02:20:19.136Z",
"role": "SUPERADMIN",
"view": {},
"oauthProviders": [],
"totpSecret": null,
"passkeys": [],
"quota": null,
"sessions": ["MW4kw66bAsosVnaAB2VyuCRt6Sh2XNfo"]
}
}

PATCH
Request

Update the currently authenticated user.

Body

Content-Type: application/json

PropertyTypeDescription
usernamestring?~New username. Must not be already taken.
passwordstring?~New password.
avatarstring?~Base64 avatar image string, or null to remove.
viewUserViewSettings?~Object with user interface/view preferences.

All properties are optional. If a property is not provided, it will not be updated. The same goes for inside the view object, where only the provided properties will be updated.

Response

Status: 200 OK Content-Type: application/json

The same response as the GET /api/user endpoint, with the updated user information.

Error Responses

  • 400 Bad Request
    • If the username is already taken.
    • If any invalid properties are provided.


Last updated: 5/28/2025
Edit this page on GitHub