Skip to main content
POST
/
api
/
auth
/
register
Register User
curl --request POST \
  --url https://api.example.com/api/auth/register
{
  "message": "Usuario registrado con éxito"
}
Registers a new user in the system with the PATIENT role by default.

Request Body

Validation Rules

  • email: Required, must be a valid email format
  • password: Required, minimum 8 characters
  • name: Required, minimum 2 characters, maximum 100 characters

Response

{
  "message": "Usuario registrado con éxito"
}

Example Request

cURL
curl -X POST https://api.example.com/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "securePassword123",
    "name": "John Doe"
  }'

Notes

  • All registered users are automatically assigned the PATIENT role
  • Passwords are hashed using bcrypt before storage
  • The password is never returned in the response
  • An audit log entry is created upon successful registration

Build docs developers (and LLMs) love