Allow the current authenticated user to change their name, email, and phone number. Name and email cannot be empty if provided.
Name and phone are applied at once. A different email is never applied by this call: a one-time
code is mailed to the new address and the response is 202 with email_verification_required: true.
The change is completed by POST /me/change-info/verify-email with that code. An email equal to the
current one (case-insensitive) is not a change. At most one code per minute is sent per user (429
otherwise); the pending change expires after 10 minutes.
Responses
-
User information changed successfully (no email change requested)
-
Name/phone applied (if any); a verification code was mailed to the new email, which is pending until verified
-
A verification code was sent less than a minute ago
-
The verification store or mail delivery is unavailable; nothing was applied for the email
-
Bad request - validation error for name, email or phone
-
Unauthorized - invalid or missing JWT token
-
Internal server error
curl \
--request POST 'https://my.nethesis.it/backend/api/me/change-info' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "+39 333 123456"
}'
{
"name": "John Doe",
"email": "john.doe@example.com",
"phone": "+39 333 123456"
}
{
"code": 200,
"message": "profile updated successfully",
"data": {
"updated_fields": [
"name",
"phone"
]
}
}
{
"code": 202,
"message": "verification code sent to the new email address",
"data": {
"updated_fields": [
"name"
],
"email_verification_required": true,
"pending_email": "new.address@example.com"
}
}
{
"code": 429,
"message": "a verification code was sent recently, wait before requesting another",
"data": {
"retry_after_seconds": 42
}
}
{
"code": 400,
"message": "validation failed",
"data": {
"type": "validation_error",
"errors": [
{
"key": "name",
"message": "name cannot be empty",
"value": ""
}
]
}
}
{
"code": 401,
"message": "invalid token",
"data": {}
}
{
"code": 500,
"message": "internal server error",
"data": {}
}