User

Update a user by ID (admin)

PUT
/api/user/{id}

Admin endpoint: updates a target user fields (name, email, phone, designation, access role, department). Returns 409 if the new email is already in use.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/api/user/string" \  -H "Content-Type: application/json" \  -d '{    "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  }}