Update your account information using this endpoint.
- To change your email or password, you must confirm it using TOTP. If you don't have 2FA enabled in your account (token code or email), TOTP will require the current password method. Note that if 2FA is not enabled in the workspace, the 2FA headers are not required.
- If you add the
currentPasswordencrypted in SHA256 to the request body, the request won't require TOTP again.
Changelog
| Version | Description |
|---|---|
| 6.4.0 | Add bio and statusType parameters. |
| 0.62.2 | Added |
The authenticated user ID.
The authenticated user token.
Enter the 2FA code. This parameter is required if 2FA is enabled in your workspace. See the Introduction to Two-Factor Authentication document for details.
Enter the method with which you get the 2FA code. It can be email, totp, or password. This parameter is required if 2FA is enabled in your workspace.
An object of user data to be updated with the following parameters. If you enter an empty string, the user details are returned.
Email ID of the user.
The new password of the user.
The password for the user encrypted in SHA256.
The nickname of the user.
The bio of the user.
The username of the user.
Name of the user.
The status type of the user. It can be online, busy, away, or offline.
The status text of the user.
Any custom fields the user should have on their account. You must define the custom fields in the workspace settings.
OK
{
"user": {
"_id": "rbAXPnMktTFbNpwtJ",
"createdAt": "2023-02-20T13:42:07.119Z",
"services": {
"password": {
"bcrypt": "$2b$10$E9ppW3T2itbMEcDvOdWBR.NXiW3YbifRHwBhjVkt26r1XS8yNhh6u"
},
"email2fa": {
"enabled": true,
"changedAt": "2023-02-20T13:42:07.118Z"
},
"resume": {
"loginTokens": [
{
"when": "2023-09-16T09:27:10.959Z",
"hashedToken": "A1jmsVCHHH2SkXHrEJDfumN+VtUP3tcuJ/OGseGrRbA=",
"twoFactorAuthorizedHash": "3067196228a830eacd6181a6977fe86a",
"twoFactorAuthorizedUntil": "2023-09-19T16:40:58.767Z"
},
{
"when": "2023-09-18T10:37:58.218Z",
"hashedToken": "RLdxvu9dDnk6QRwFdaK3my1AoPeGaR5lTkK+zEhTuPk="
},
{
"when": "2023-09-18T10:41:25.814Z",
"hashedToken": "zWZ8wW9PNlVuI2Q65vK/9vytaONk1BXxaWcNld4qvEc="
}
]
},
"email": {
"verificationTokens": [
{
"token": "lHq_4L8Orgxu2p5NhfVb0V9kA7kO1VaBXA5GmaJiuX3",
"address": "test@test.com",
"when": "2023-05-23T18:47:07.142Z"
}
]
},
"totp": {
"enabled": false
},
"passwordHistory": [
"$2b$10$n1.FV8S2mxz7GzXA392V5OaDa5X0WR1DQ4eGGFKI/wpdhS9sVIC6S",
"$2b$10$4I68O5mlR.C8dRhtZ4Mj6us6EMwRHNIUqEWQe/nOhISs4e8RtOliW",
"$2b$10$AU9Ncfd8bO5TpE.5iLMjyujdd6RVJaoeKckVqo3MMO9Ngc3oyMAs2"
]
},
"username": "roxie",
"emails": [
{
"address": "test@test.com",
"verified": true
}
],
"type": "user",
"status": "offline",
"active": true,
"_updatedAt": "2023-09-19T16:10:58.873Z",
"__rooms": [
"GENERAL",
"siyr2oWQJBjQjhLwr",
"6GFJ3tbmHiyHbahmC",
"64f0f82c2c26843a68c1f7ba"
],
"roles": [
"user",
"admin",
"livechat-agent",
"livechat-manager"
],
"name": "test test",
"settings": {
"preferences": {
"themeAppearence": "light"
},
"profile": {}
},
"lastLogin": "2023-09-19T16:00:19.657Z",
"statusConnection": "away",
"utcOffset": 1,
"banners": {
"versionUpdate-6_0_0": {
"id": "versionUpdate-6_0_0",
"priority": 10,
"title": "Update_your_RocketChat",
"text": "New_version_available_(s)",
"textArguments": [
"6.0.0"
],
"link": "https://github.com/RocketChat/Rocket.Chat/releases/tag/6.0.0",
"modifiers": [],
"read": true
},
"versionUpdate-6_2_8": {
"id": "versionUpdate-6_2_8",
"priority": 10,
"title": "Update_your_RocketChat",
"text": "New_version_available_(s)",
"textArguments": [
"6.2.8"
],
"link": "https://github.com/RocketChat/Rocket.Chat/releases/tag/6.2.8",
"modifiers": []
}
},
"statusDefault": "offline",
"statusText": "On a vacation",
"operator": true,
"livechatStatusSystemModified": false,
"statusLivechat": "available",
"livechatCount": 8,
"livechat": {
"maxNumberSimultaneousChat": ""
},
"bio": "Engineer",
"nickname": ""
},
"success": true
}Bad Request
{
"success": false,
"error": "must have required property 'data' [invalid-params]",
"errorType": "invalid-params"
}Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}