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 '
{
  "email": "<string>",
  "password": "<string>",
  "firstName": "<string>",
  "lastName": "<string>",
  "currency": "<string>"
}
'
{
  "user": {
    "id": "<string>",
    "email": "<string>",
    "firstName": "<string>",
    "lastName": "<string>",
    "currency": "<string>",
    "role": "<string>",
    "avatarUrl": {}
  },
  "token": "<string>",
  "409 Conflict": {},
  "400 Bad Request": {}
}

Request Body

email
string
required
User’s email address. Must be a valid email format.
password
string
required
User’s password. Must be at least 8 characters and no more than 100 characters.
firstName
string
required
User’s first name. Minimum 2 characters.
lastName
string
required
User’s last name. Minimum 2 characters.
currency
string
default:"ARS"
Preferred currency for the user’s account. Examples: “USD”, “EUR”, “ARS”

Response

user
object
The created user object
token
string
JWT authentication token for the user session

Example Request

curl -X POST https://api.yourfinanceapp.com/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "SecurePass123!",
    "firstName": "John",
    "lastName": "Doe",
    "currency": "USD"
  }'

Example Response

{
  "user": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "email": "[email protected]",
    "firstName": "John",
    "lastName": "Doe",
    "currency": "USD",
    "role": "USER",
    "avatarUrl": null
  },
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI1NTBlODQwMC1lMjliLTQxZDQtYTcxNi00NDY2NTU0NDAwMDAiLCJlbWFpbCI6ImpvaG4uZG9lQGV4YW1wbGUuY29tIiwicm9sZSI6IlVTRVIiLCJpYXQiOjE3MDk1NjE2MDB9.abc123def456"
}

Error Responses

409 Conflict
error
Email address is already registered
{
  "statusCode": 409,
  "message": "El email ya está registrado",
  "error": "Conflict"
}
400 Bad Request
error
Validation error - invalid input data
{
  "statusCode": 400,
  "message": [
    "email must be an email",
    "La contraseña debe tener al menos 8 caracteres",
    "firstName must be longer than or equal to 2 characters"
  ],
  "error": "Bad Request"
}

Additional Information

Upon successful registration, the system automatically:
  • Creates a default wallet account (“Efectivo / Billetera”) with zero balance
  • Initializes default income and expense categories
  • Sets the auth provider to LOCAL
  • Assigns the USER role
  • Sets fiscal start day to 1
The returned JWT token should be stored securely and included in subsequent authenticated requests.

Build docs developers (and LLMs) love