cURL
curl --request POST \ --url https://api.example.com/api/users \ --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>" } '
{ "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": {} }
Create a new user in the system
curl -X POST 'http://localhost:8080/api/users' \ -H 'Content-Type: application/json' \ -d '{ "username": "johndoe", "email": "[email protected]", "password_hash": "mySecurePassword123", "firstname": "John", "lastname": "Doe", "phone_number": "+1234567890", "role": "USER", "is_active": true, "profileImage": "/images/profiles/johndoe.jpg" }'
{ "id": 3, "username": "johndoe", "email": "[email protected]", "password_hash": "$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy", "firstname": "John", "lastname": "Doe", "phone_number": "+1234567890", "role": "USER", "is_active": true, "profileImage": "/images/profiles/johndoe.jpg", "created_at": "2024-01-25T15:30:00Z", "updated_at": "2024-01-25T15:30:00Z" }
id
password_hash