Updates the profile avatar of the currently authenticated user. Accepts image file upload.
PATCH
/auth/user/me/avatar
curl \
--request PATCH 'http://localhost:8080/api/auth/user/me/avatar' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: multipart/form-data" \
--form "avatar=@file"
Response examples (200)
{
"success": true,
"code": 200,
"message": "string",
"data": {
"avatarUrl": "https://cdn.example.com/avatars/user_12345.jpg"
}
}
Response examples (400)
{
"success": false,
"code": 42,
"errorCode": "INVALID_AVATAR_FILE",
"message": "Avatar must be a valid image file (JPG, PNG, GIF) and less than 5MB",
"timestamp": "2025-05-04T09:42:00Z"
}
Response examples (413)
{
"success": false,
"code": 42,
"errorCode": "FILE_TOO_LARGE",
"message": "Avatar file size must not exceed 5MB",
"timestamp": "2025-05-04T09:42:00Z"
}
Response examples (500)
{
"success": false,
"code": 42,
"errorCode": "string",
"message": "string",
"timestamp": "2025-05-04T09:42:00Z"
}