Updates the authenticated user’s profile information (name and/or email).
Authentication
This endpoint requires both API key and JWT authentication.
Your API key for accessing the API
Bearer token in the format: Bearer <token>
Request Body
At least one field must be provided for the update.
New email address for the user. Must be unique and not already registered.
Response
Indicates if the request was successful
Response message indicating the result of the update operation
Example Request
curl --request PATCH \
--url https://api.example.com/api/user \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
--header 'Content-Type: application/json' \
--header 'x-api-key: your_api_key_here' \
--data '{
"name": "Jane Doe",
"email": "[email protected]"
}'
Example Response
{
"success": true,
"message": "User updated successfully"
}
Error Responses
{
"error": "Access Denied"
}
Notes
- Both
name and email fields are optional, but at least one must be provided
- If updating email, the new email must not already be registered in the system
- The update is performed atomically - either all changes succeed or none are applied