Back to User Management
Update User
Updates an existing user's information.
Request Details
path Parameters
Field | Type | Required | Description |
---|---|---|---|
userId | string | Yes | The unique identifier of the user to update. |
body Parameters
Field | Type | Required | Description |
---|---|---|---|
id | string | Yes | Unique identifier for the user |
name | string | Yes | Full name of the user |
string | Yes | Email address of the user | |
password | string | Yes | User's password (write-only) |
createdAt | string date-time | No | Timestamp when the user was created |
updatedAt | string date-time | No | Timestamp when the user was last updated |
lastLogin | string date-time | No | Timestamp of the user's last login |
settings | object UserSettings | No | User-specific settings. See UserSettings schema. |
Sample Request & Response
PUT
/users/{userId}Updates an existing user's information.
Sample Request
Headers:
{
"Content-Type": "application/json",
"Authorization": "Bearer <YOUR_AUTH_TOKEN>"
}
Path Parameters:
{
"userId": "string (required) - The unique identifier of the user to update."
}
Body:
{
"name": "Jane Doe",
"email": "jane.doe@example.com",
"settings": {
"notificationsEnabled": false
}
}
Sample Response (200)
{
"id": "usr_abc123xyz",
"name": "Jane Doe",
"email": "jane.doe@example.com",
"updatedAt": "2024-07-24T12:00:00Z",
"settings": {
"notificationsEnabled": false,
"theme": "dark"
}
}