cURL
curl --request PUT \ --url https://api.example.com/api/management/users/{id} \ --header 'Content-Type: application/json' \ --data ' { "firstName": "<string>", "lastName": "<string>", "email": "<string>", "roles": [ {} ] } '
{ "success": true, "timestamp": "<string>", "data": { "data.email": "<string>", "data.firstName": "<string>", "data.lastName": "<string>", "data.roles": [ {} ] } }
Update an existing user’s information
PUT /api/management/users/{id}
Authorization: Bearer <your_jwt_token>
MEMBER
ADMIN
["MEMBER"]
["ADMIN", "MEMBER"]
curl -X PUT "http://localhost:8080/api/management/users/1" \ -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \ -H "Content-Type: application/json" \ -d '{ "firstName": "John", "lastName": "Smith", "email": "[email protected]", "roles": ["MEMBER", "ADMIN"] }'
{ "success": true, "timestamp": "2026-03-03T10:30:00Z", "data": { "email": "[email protected]", "firstName": "John", "lastName": "Smith", "roles": ["MEMBER", "ADMIN"] } }
{ "success": false, "timestamp": "2026-03-03T10:30:00Z", "error": { "code": "VALIDATION_ERROR", "message": "Validation failed", "details": [ { "field": "firstName", "message": "Name must be between 2 and 50 characters" }, { "field": "email", "message": "Invalid email format" }, { "field": "roles", "message": "At least one role must be assigned" } ] } }
{ "success": false, "timestamp": "2026-03-03T10:30:00Z", "error": { "code": "UNAUTHORIZED", "message": "Authentication required" } }
{ "success": false, "timestamp": "2026-03-03T10:30:00Z", "error": { "code": "FORBIDDEN", "message": "Access denied. ADMIN role required." } }
{ "success": false, "timestamp": "2026-03-03T10:30:00Z", "error": { "code": "USER_NOT_FOUND", "message": "User not found with id: 999" } }
{ "success": false, "timestamp": "2026-03-03T10:30:00Z", "error": { "code": "EMAIL_ALREADY_EXISTS", "message": "Email address is already in use" } }