Update User Details

Prev Next
Post
/api/v1/users.update

Use this endpoint to update the details of an existing user. This endpoint requires 2FA.

Permissions required:

  • edit-other-user-password: Permission to modify other user's passwords
  • edit-other-user-info_description: Permission to change other user's name, username or email address
  • edit-other-user-active-status: Permission to enable or disable other accounts

Changelog

Version Description
7.0.0 Removed upsert behaviour and stopped allowing joinDefaultChannels param
0.48.0 Renamed to users.update
0.35.0 Added
Header parameters
X-User-Id
stringRequired

The authenticated user ID.

ExamplerbAXPnMktTFbNpwtJ
X-Auth-Token
stringRequired

The authenticated user token.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
x-2fa-code
stringRequired

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.

Example148750
x-2fa-method
stringRequired

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.

Body parameters
Expand All
object
userId
string Required

The user ID to update. This value must not be empty.

ExamplePMGoujw82oETsaw9828rQh2oXM
data
object Required

The object that includes the user information to update with the following parameters. Note: If you provide an empty object, the user details are returned.

name
string

The name of the user.

ExampleAgent 2 Updated
email
string

The email ID of the user.

Exampleagent2@agent.com
password
string

The password for the user.

Examplepassw0rd
username
string

The username for the user.

Exampleexample
active
boolean

Whether the user is active, which determines if they can log in. Setting this to false deactivates the user. If the user is the last owner of any room, or the only member of a private room, the request fails with user-last-owner unless confirmRelinquish is also true. See confirmRelinquish.

Defaulttrue
roles
Array of string

The roles the user has been assigned.

string
requirePasswordChange
boolean

Whether the user should be required to change their password when they login.

Defaultfalse
sendWelcomeEmail
boolean

Whether the user should get a welcome email.

Defaultfalse
freeSwitchExtension
string

The voice call extension.

verified
boolean

Whether the user's email address should be verified.

Defaulttrue
customFields
object

Any custom fields the user should have on their account. To save custom fields, you must first define the custom fields in the admin panel (Manage > Workspace > Settings > Accounts > Registration > Custom Fields). For details on how to configure this field, see Custom Fields. For information on how to view the custom fields, see the Get Users List endpoint.

Example{ "clearance": "High", "team": "Queen" }
confirmRelinquish
boolean

Top-level body parameter (not inside data). Only used when data.active is false. Set to true to deactivate the user even if they are the last owner of a room, or the only member of a private room. If the room has other active members, the member who joined earliest becomes the new owner. If the user is the only member of a private room, or no other active member can take ownership, that room is deleted, together with every discussion that belongs to it. Public channels are not deleted. If omitted or false and the user is the last owner of any room, the request fails with user-last-owner and the user's active status is not changed.

Defaultfalse
Responses
200

OK

Example
{
  "user": {
    "_id": "PMGoujw82oETsaw9828rQh2oXM",
    "createdAt": "2026-02-24T23:22:54.986Z",
    "username": "agent2",
    "emails": [
      {
        "address": "agent2@agent.com",
        "verified": false
      }
    ],
    "type": "user",
    "roles": [
      "user",
      "livechat-agent"
    ],
    "status": "offline",
    "active": true,
    "inactiveReason": null,
    "name": "Agent 2 Updated",
    "_updatedAt": "2026-02-25T14:25:59.157Z",
    "__rooms": [
      "GENERAL"
    ],
    "requirePasswordChange": false,
    "settings": {},
    "statusText": "",
    "livechatStatusSystemModified": false,
    "statusLivechat": "not-available"
  },
  "success": true
}
Expand All
object
user
object
_id
string
createdAt
string
username
string
emails
Array of object
object
address
string
verified
boolean
type
string
roles
Array of string
string
status
string
active
boolean
inactiveReason
string
name
string
_updatedAt
string
__rooms
Array of string
string
requirePasswordChange
boolean
settings
object
statusText
string
livechatStatusSystemModified
boolean
statusLivechat
string
success
boolean
400

Bad Request

Example 1
{
  "success": false,
  "error": "Editing user is not allowed [error-action-not-allowed]",
  "errorType": "error-action-not-allowed",
  "details": {
    "method": "insertOrUpdateUser",
    "action": "Editing_user"
  }
}
user-last-owner
{
  "success": false,
  "error": "[user-last-owner]",
  "errorType": "user-last-owner",
  "details": {
    "shouldBeRemoved": [
      "cascade-test-group"
    ],
    "shouldChangeOwner": []
  }
}
Expand All
object
success
boolean
error
string
errorType
string
details
object
method
string
action
string
shouldBeRemoved
Array of string
string
shouldChangeOwner
Array of string
string
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string