Update User
This endpoint allows you to update an existing user's information. Only the fields you provide will be modified, while others remain unchanged.
πΉ Endpoint Detailsβ
PUT /api/v1/users/{id}
π Authenticationβ
| Header | Required | Description |
|---|---|---|
| Content-Type | Yes | Must be application/json |
| Authorization | Yes | Format: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature |
π Request Structureβ
Path Parametersβ
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| id | string (UUID) | Yes | Unique identifier of the user | 550e8400-e29b-41d4-a716-446655440000 |
Updatable Fieldsβ
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
| firstName | string | No | New first name | "Johnny" |
| lastName | string | No | New last name | "Doe" |
| role | enum | No | New user role | "editor" |
| avatar | string | No | New avatar URL | "https://example.com/avatars/new.jpg" |
| userGroupId | string | No | New group association | "123e4567-e89b-12d3-a456-426614174000" |
π§© Request Exampleβ
curl -X PUT "https://openapi.onlive.site/api/v1/users/550e8400-e29b-41d4-a716-446655440000" \
-H "Content-Type: application/json" \
-H "Authorization: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature" \
-d '{
"firstName": "Johnny",
"role": "editor",
"avatar": "https://example.com/avatars/johnny.jpg",
"userGroupId": "123e4567-e89b-12d3-a456-426614174000"
}'
π€ Response Formatβ
Successful Response (200 OK)β
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"firstName": "Johnny",
"lastName": "Doe",
"email": "[email protected]",
"role": "editor",
"avatar": "https://example.com/avatars/johnny.jpg",
"organizationId": "123e4567-e89b-12d3-a456-426614174000",
"userGroupId": "123e4567-e89b-12d3-a456-426614174000",
"fullName": "Johnny Doe",
"createdAt": "2025-05-22T10:30:00Z",
"updatedAt": "2025-05-22T11:15:00Z"
}
β Error Responsesβ
This endpoint follows the standard error format.
π Notesβ
- Only include fields you want to update in the request body
- Email address cannot be updated through this endpoint
- The
fullNameis automatically updated when name fields change - The
updatedAttimestamp is automatically updated - Omitted fields retain their current values
- You can only update users within your organization
- Role changes may affect user permissions immediately
β Common Use Casesβ
- π Profile Update: Change user's personal information
- π Role Change: Promote or modify user permissions
- π₯ Group Transfer: Move user to different group
- πΌοΈ Avatar Update: Change profile picture
- π Access Control: Adjust user roles and permissions
π Update Restrictionsβ
-
Immutable Fields
- Email address
- Organization ID
- Creation timestamp
- User ID
-
Role Changes
- Must have appropriate permissions
- Limited to available roles
- Immediate effect on permissions
-
Group Changes
- User can belong to only one group
- Previous group association is replaced
- Group must exist in same organization
π·οΈ Field Validationβ
-
Names
- Minimum length: 1 character
- Maximum length: 100 characters
- Special characters allowed
-
Avatar URL
- Must be HTTPS
- Maximum length: 2048 characters
- Must be accessible URL
-
Role
- Must be valid role:
creator,editor,admin - Case sensitive
- Cannot assign
rootrole
- Must be valid role: