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
400 Bad Request
{
"statusCode": 400,
"message": "Invalid input",
"errors": [
{
"field": "role",
"message": "must be one of: creator, editor, admin"
}
]
}
401 Unauthorized
{
"statusCode": 401,
"message": "Invalid or missing authorization credentials"
}
404 Not Found
{
"statusCode": 404,
"message": "User not found"
}
📘 Notes
- Only include fields you want to update in the request body
- Email address cannot be updated through this endpoint
- The
fullName
is automatically updated when name fields change - The
updatedAt
timestamp 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
root
role
- Must be valid role: