Skip to main content

Update user profile (Admin only)

PUT 

/company/users/:id

Allows an administrator to edit the profile of any user in the company.

Objective

To facilitate user management by administrators, enabling them to modify the data of any user in the company.

Use Cases

  • Update a user's data as an administrator
  • Change a user's role
  • Modify a user's email
  • Update contact information

Authentication & Authorization

  • Requires a valid JWT (middleware m.isLogged)
  • Requires admin or dev role (middleware m.isAdmin)
  • Requires UTC validation (mTools.checkUTC)

Validations

  • Email validated to prevent duplicates
  • Role validated with model.getValidRole()
  • Data validated with model.validateData()
  • Verifies that the user belongs to the company

Notes

  • Similar to PUT /me but for any user in the company
  • Only administrators can access

Request

Responses

Profile updated successfully