Skip to main content
POST
/
api
/
auth
/
register
Register User
curl --request POST \
  --url https://api.example.com/api/auth/register \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "email": "<string>",
  "password": "<string>"
}
'
{
  "success": true,
  "message": "<string>",
  "data": {
    "user": {
      "_id": "<string>",
      "name": "<string>",
      "email": "<string>",
      "role": "<string>",
      "isActive": true,
      "createdAt": "<string>",
      "updatedAt": "<string>"
    },
    "token": "<string>"
  }
}
Registers a new user in the system and returns an authentication token.

Authentication

No authentication required. This is a public endpoint.
This endpoint is rate-limited to 5 requests per 15 minutes per IP address.

Request Body

name
string
required
User’s full name. Must be between 2 and 50 characters.
email
string
required
User’s email address. Must be a valid email format. Will be converted to lowercase.
password
string
required
User’s password. Must be at least 6 characters and contain at least one letter and one number.

Response

success
boolean
Indicates if the request was successful
message
string
Success message: “Usuario registrado exitosamente”
data
object
user
object
_id
string
Unique user identifier
name
string
User’s full name
email
string
User’s email address (lowercase)
role
string
User’s role. Default: “user”. Possible values: “user”, “admin”, “system”
isActive
boolean
Whether the user account is active. Default: true
createdAt
string
ISO 8601 timestamp of account creation
updatedAt
string
ISO 8601 timestamp of last update
token
string
JWT authentication token (expires in 7 days)

Error Responses

400 - Email Already Registered
{
  "success": false,
  "message": "El email ya está registrado"
}
400 - Validation Error
{
  "success": false,
  "message": "Validation failed",
  "errors": [
    {
      "field": "password",
      "message": "La contraseña debe contener al menos una letra y un número"
    }
  ]
}
429 - Rate Limit Exceeded
{
  "success": false,
  "message": "Demasiados intentos de autenticación. Intenta en 15 minutos.",
  "retryAfter": 900
}

Examples

curl -X POST https://api.cuido.com/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Juan Pérez",
    "email": "[email protected]",
    "password": "SecurePass123"
  }'

Response Example

{
  "success": true,
  "message": "Usuario registrado exitosamente",
  "data": {
    "user": {
      "_id": "507f1f77bcf86cd799439011",
      "name": "Juan Pérez",
      "email": "[email protected]",
      "role": "user",
      "isActive": true,
      "createdAt": "2026-03-05T10:30:00.000Z",
      "updatedAt": "2026-03-05T10:30:00.000Z"
    },
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI1MDdmMWY3N2JjZjg2Y2Q3OTk0MzkwMTEiLCJ0aW1lc3RhbXAiOjE3MDk2MzU4MDAwMDAsImlhdCI6MTcwOTYzNTgwMCwiZXhwIjoxNzEwMjQwNjAwLCJpc3MiOiJjbGF1ZGUtcHJvbXB0LWFwaSIsInN1YiI6IjUwN2YxZjc3YmNmODZjZDc5OTQzOTAxMSJ9.abc123xyz"
  }
}

Build docs developers (and LLMs) love