Endpoint
Updates user information including name, email, push token, and notification preferences. All fields are optional - only include the fields you want to update.
Path parameters
The unique identifier (UUID) of the user to update
Request body
Updated email address (must be valid email format)
Updated Firebase Cloud Messaging token for push notifications
Updated notification preferences Enable or disable email notifications
Enable or disable push notifications
Response
Returns the updated user object with all fields.
User’s unique identifier (UUID)
Updated FCM token (or null if not set)
Updated notification preferences
ISO 8601 timestamp of the update
Example request
curl -X PUT http://localhost:8001/api/v1/users/123e4567-e89b-12d3-a456-426614174000 \
-H "Content-Type: application/json" \
-d '{
"name": "John Updated",
"push_token": "new_fcm_token_xyz789"
}'
const response = await fetch (
'http://localhost:8001/api/v1/users/123e4567-e89b-12d3-a456-426614174000' ,
{
method: 'PUT' ,
headers: {
'Content-Type' : 'application/json'
},
body: JSON . stringify ({
name: 'John Updated' ,
push_token: 'new_fcm_token_xyz789'
})
}
);
const updatedUser = await response . json ();
import requests
user_id = '123e4567-e89b-12d3-a456-426614174000'
response = requests.put(
f 'http://localhost:8001/api/v1/users/ { user_id } ' ,
json = {
'name' : 'John Updated' ,
'push_token' : 'new_fcm_token_xyz789'
}
)
updated_user = response.json()
Example response
{
"id" : "123e4567-e89b-12d3-a456-426614174000" ,
"name" : "John Updated" ,
"email" : "[email protected] " ,
"push_token" : "new_fcm_token_xyz789" ,
"preferences" : {
"email" : true ,
"push" : true
},
"created_at" : "2024-03-01T10:00:00Z" ,
"updated_at" : "2024-03-03T16:45:00Z"
}
Error responses
User with the specified ID does not exist {
"statusCode" : 404 ,
"message" : "User not found"
}
Invalid email format or malformed request {
"statusCode" : 400 ,
"message" : "Validation failed" ,
"errors" : [ "email must be a valid email" ]
}
Use cases
Update user profile information
Change notification device token when user logs in on new device
Modify contact information
Combined with preferences update for comprehensive profile changes
This endpoint updates the entire user object. Use the Update user preferences endpoint if you only need to modify notification settings.