Skip to main content
The JWT access token expires after 120 minutes. The refresh token expires after 240 minutes. Use the Refresh Token endpoint to obtain a new token pair before your session expires.

Request

POST /api/auth/register No authentication required.

Body

firstName
string
required
The user’s first name.
lastName
string
required
The user’s last name.
location
string
required
The user’s location or address.
email
string
required
The user’s email address. Must be a valid email format. Used as the login username.
password
string
required
The account password. Must be at least 8 characters and include at least one uppercase letter, one lowercase letter, one digit, and one special character (@$!%*?&).
confirmPassword
string
required
Must match password exactly.

Response

statusCode
number
HTTP status code of the operation. 200 on success, 400 on failure.
status
boolean
true if the account was created successfully, false otherwise.
message
string
A human-readable message describing the result.
data
object
Present on success. Contains the new user’s token and profile information.
curl --request POST \
  --url https://localhost:7191/api/auth/register \
  --header 'Content-Type: application/json' \
  --data '{
    "firstName": "Jane",
    "lastName": "Doe",
    "location": "San José, Costa Rica",
    "email": "jane.doe@example.com",
    "password": "MyPassword1!",
    "confirmPassword": "MyPassword1!"
  }'
{
  "statusCode": 200,
  "status": true,
  "message": "Registro exitoso.",
  "data": {
    "fullName": "Jane Doe",
    "email": "jane.doe@example.com",
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "tokenExpiration": "2024-01-15T14:30:00Z",
    "refreshToken": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4...",
    "refreshTokenExpire": "2024-01-15T16:30:00Z"
  }
}

Build docs developers (and LLMs) love