Unicat API Reference

Up - API Reference - Home


/api/account/update_email

Requires JWT.

Complete the update for the email address. If successful, all subsequent email communication will use the new one.

Note: updating the email address is a two-step process; the first step initiates the action (see /api/account/update_email_request), this is the second step that completes it.

Request

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

{
    "email": "<your-new-email>",
    "validation_code": "<validation-code-from-response>",
    "verification_code": "<verification-code-from-email>",
}

email is the same email as step 1.
validation_code is the validation code returned from step 1.
verification_code is the 6-character code received by email. This one-time code is valid for 15 minutes.

Note: if you want to change the email address from the one you provided in step 1, you'll have to start a new request.

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 - invalid verification/validation codes - see Validation information