Unicat API Reference

Up - API Reference - Home


/api/account/update

Requires JWT.

Update properties for the current account.

Request

POST /api/account/update
Authorization: Bearer <JWT>

{
    "username": "unicat",
    "password": "********",
    "name": "Unicat",
    "language": "en",
    "timezone": "Europe/Amsterdam",
}

optional

These are all optional, but at least one must be provided.

username a new username (will be checked for availability). A username is case-sensitive.
password a new password (will be checked for strongness).
name the user's full name.
language preferred user interface language - only en for now.
timezone preferred user interface timezone - only Europe/Amsterdam for now.

To update the email address, see /api/account/update_email_request.
To update the avatar, see /api/account/upload_avatar.

Success response

Authorization: <JWT>

{
    "success": true,
    "result": {
        "user": "<user gid>"
    },
    "data": {
        "cc.users": {
            "<user gid>": {
                "gid": "<user gid>",
                "username": "unicat",
                "email": "<user email>",
                "name": "Unicat",
                "avatar": null,
                "status": "active",
                "options": {
                    "language": "en",
                    "timezone": "Europe/Amsterdam"
                }
            }
        }
    }
}

result

user is the user gid for the current account.

data

cc.users is a dictionary with one entry for the user.

Error response

400 Bad request - missing argument
401 Unauthorized - missing or expired JWT
1001 Validation error - unavailable username or weak password - see Validation information