cURL
curl --request PUT \ --url https://api.example.com/api/users/{id} \ --header 'Content-Type: application/json' \ --data ' { "username": "<string>", "email": "<string>", "password_hash": "<string>", "firstname": "<string>", "lastname": "<string>", "phone_number": "<string>", "role": "<string>", "is_active": true, "profileImage": "<string>" } '
{ "404": {}, "id": 123, "username": "<string>", "email": "<string>", "password_hash": "<string>", "firstname": "<string>", "lastname": "<string>", "phone_number": "<string>", "role": "<string>", "is_active": true, "profileImage": "<string>", "created_at": {}, "updated_at": {} }
Update an existing user’s information
curl -X PUT 'http://localhost:8080/api/users/1' \ -H 'Content-Type: application/json' \ -d '{ "username": "johndoe_updated", "email": "[email protected]", "password_hash": "newSecurePassword456", "firstname": "John", "lastname": "Doe", "phone_number": "+1234567890", "role": "ADMIN", "is_active": true, "profileImage": "/images/profiles/johndoe_new.jpg" }'
{ "id": 1, "username": "johndoe_updated", "email": "[email protected]", "password_hash": "$2a$10$X7qp9uZOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy", "firstname": "John", "lastname": "Doe", "phone_number": "+1234567890", "role": "ADMIN", "is_active": true, "profileImage": "/images/profiles/johndoe_new.jpg", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-26T16:45:00Z" }
id
password_hash