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
The user’s location or address.
The user’s email address. Must be a valid email format. Used as the login username.
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 (@$!%*?&).
Must match password exactly.
Response
HTTP status code of the operation. 200 on success, 400 on failure.
true if the account was created successfully, false otherwise.
A human-readable message describing the result.
Present on success. Contains the new user’s token and profile information. The user’s full name (first name and last name).
The user’s email address.
The JWT access token. Include this as a Bearer token in the Authorization header for authenticated requests.
ISO 8601 datetime indicating when the access token expires (120 minutes from issue time).
The refresh token used to obtain a new access token pair.
ISO 8601 datetime indicating when the refresh token expires (240 minutes from issue time).
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!"
}'
200 Success
400 Bad Request
{
"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"
}
}