Skip to main content
PUT
/
api
/
users
/
me
Edit my profile
curl --request PUT \
  --url https://api.example.com/api/users/me
{
  "success": true,
  "timestamp": "<string>",
  "data": {
    "id": 123,
    "email": "<string>",
    "firstName": "<string>",
    "lastName": "<string>",
    "roles": [
      {}
    ]
  }
}

Endpoint

PUT /api/users/me

Authentication

Requires a valid JWT access token in the Authorization header.
Authorization: Bearer <access_token>

Request Body

firstName
string
required
User’s first nameValidation:
  • Not blank
  • 2-50 characters
  • Letters, spaces, periods, hyphens, and apostrophes only
lastName
string
required
User’s last nameValidation:
  • Not blank
  • 2-50 characters
  • Letters, spaces, periods, hyphens, and apostrophes only
Users can only update their first and last name. Email and roles cannot be changed through this endpoint.

Response

Returns the updated profile information.
success
boolean
Indicates if the request was successful
timestamp
string
ISO 8601 timestamp of the response
data
object
Updated profile data

Example Request

curl -X PUT http://localhost:8080/api/users/me \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Jane",
    "lastName": "Smith"
  }'

Example Response

{
  "success": true,
  "timestamp": "2026-03-03T10:30:00Z",
  "data": {
    "id": 1,
    "email": "[email protected]",
    "firstName": "Jane",
    "lastName": "Smith",
    "roles": ["MEMBER"]
  }
}

Error Responses

{
  "success": false,
  "timestamp": "2026-03-03T10:30:00Z",
  "error": "Validation failed",
  "details": {
    "firstName": "Name must be between 2 and 50 characters"
  }
}
The request body failed validation.
{
  "success": false,
  "timestamp": "2026-03-03T10:30:00Z",
  "error": "Unauthorized"
}
The access token is missing, invalid, or expired.

Source Reference

This endpoint is implemented in:
  • UserController.java:26-29
  • Request DTO: UserEditProfileRequest.java:7-17

Build docs developers (and LLMs) love