Skip to main content
PUT
/
api
/
user
/
{id}
Update a user by ID (admin)
curl --request PUT \
  --url https://your-instance.example.com/api/user/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "fullName": "Alex Rep",
  "accessRole": "DEPARTMENT_HEAD",
  "departmentId": "64eea1110000000000000020"
}
'
{
  "success": true,
  "message": "User updated successfully",
  "data": {
    "_id": "5f7b1c2e8a1d4e0012c3b4a6",
    "fullName": "Sam Patel",
    "email": "sam.patel.new@acme.example",
    "accessRole": "AGENT",
    "organizationId": "64a1b2c3d4e5f60012345678",
    "loginDisabled": false
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Body

application/json
fullName
string

Display name shown across the UI for the target user.

email
string<email>

New login email; endpoint returns 409 if another user already has this email.

phoneNumber
string

Target user personal mobile number (E.164 preferred).

sinchPhoneNumber
string

Assigned Sinch outbound number; used as the from-number on user-attributed SMS.

designation
string

Free-form job title (e.g., "Senior Account Executive"); display only.

accessRole
string

Role granted to the user: SUPERADMIN, ADMIN, DEPARTMENT_HEAD, SALES_REP. Only SUPERADMIN callers may change this field.

departmentId
string

ObjectId of the Department the user belongs to; changes are mirrored to the department managerIds list for DEPARTMENT_HEAD users.

Response

User updated

Returned by admin PUT /api/user/{id}.

success
enum<boolean>
required
Available options:
true
message
string
required
data
object
required

Compact user payload returned by POST /api/user/list (bare array — no envelope).

Example:
{
"_id": "5f7b1c2e8a1d4e0012c3b4a6",
"fullName": "Sam Patel",
"email": "sam.patel@acme.example",
"phoneNumber": "+14165550100",
"accessRole": "AGENT",
"organizationId": "64a1b2c3d4e5f60012345678",
"loginDisabled": false
}