Skip to main content
PUT
/
api
/
adm
/
users
/
{id}
Update User
curl --request PUT \
  --url https://localhost:44371/api/adm/users/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "[email protected]",
  "id": "<string>",
  "firstName": "<string>",
  "lastName": "<string>"
}
'
{
  "success": true,
  "code": 200,
  "errorMessage": null
}

Description

Modifies an existing user’s profile and authentication details. This endpoint allows administrators to update user information including contact details, password resets, and account status changes. Common scenarios include correcting user information, handling password reset requests, and managing account access through active status changes.

Input

  • Path Parameter: id (guid, required) — Unique identifier of the user to update (must match ID in request body).
  • Body: model (UserUpdateCommandRequest, required) — Updated user information including:
    • id (guid, required) — User identifier (must match path parameter).
    • email (string, required) — Updated email address.
    • firstName (string, required) — Updated first name.
    • lastName (string, required) — Updated last name.
    • phoneNumber (string, optional) — Updated phone number.
    • password (string, optional) — New password (omit to keep existing).
    • isActive (bool, optional) — Active status.

Output

Returns a UserUpdateCommandResponse indicating whether the update was successful.

Example Request

PUT /api/admin/users/3fa85f64-5717-4562-b3fc-2c963f66afa6
Content-Type: application/json
Authorization: Bearer {token}

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "email": "[email protected]",
  "firstName": "John",
  "lastName": "Smith",
  "phoneNumber": "555-0199",
  "isActive": true
}

Example Response

{
  "success": true,
  "code": 200,
  "errorMessage": null
}

Errors

  • 400 Bad Request — Missing required fields, email already exists, invalid email format, or field exceeds maximum length.
  • 404 Not Found — No user exists with the specified ID.
  • 401 Unauthorized — Missing or invalid authentication token.
  • 403 Forbidden — User does not have permission to update users.

Notes

  • Email changes must maintain uniqueness across the platform.
  • Password field is optional; omit to keep existing password unchanged.
  • Setting isActive to false immediately prevents user authentication.
  • Changes take effect immediately without caching delay.
  • User ID in the route path and request body must match.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

id
string<guid>
required

The unique identifier of the user to update (must match ID in request body).

Body

application/json

The update request containing updated profile fields (email, name, phone, password, active status).

Represents the payload used to update basic user information.

email
string<email>
required

The email address used to contact the user.

Maximum string length: 250
id
string<guid>

The identifier of the user being updated.

firstName
string | null

First Name

Maximum string length: 150
lastName
string | null

Last Name

Maximum string length: 150

Response

Always returned. Check the success property in the response body to determine if the operation succeeded.

Standard response structure containing operation status and error information. Standard command response indicating the result of a data modification. Represents the response returned after updating user information.

success
boolean

True if the operation completed successfully; false if an error occurred.

Example:

true

code
enum<string>

Result code indicating the outcome of the operation.

Available options:
Unknown,
Success,
BadRequest,
Unauthorized,
NotFound,
Error
Example:

200

errorMessage
string | null

Human-readable error message when an error occurs.

Example:

null