Skip to main content

POST /api/register

Creates a new user account with the provided credentials. The password is securely hashed using bcrypt before being stored in the database.

Request Body

name
string
required
The full name of the user
email
string
required
The user’s email address. Must be unique across the platform.
password
string
required
The user’s password. Will be hashed before storage for security.

Example Request

curl -X POST http://localhost:3001/api/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Doe",
    "email": "[email protected]",
    "password": "securePassword123"
  }'

Response

message
string
Confirmation message indicating successful registration

Success Response (201 Created)

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

Error Responses

Implementation Details

  • Passwords are hashed using bcrypt with a salt round of 10
  • Email uniqueness is enforced at the database level
  • All three fields (name, email, password) are required for registration
  • Successfully created users receive a 201 status code

Build docs developers (and LLMs) love