Login
curl --request POST \
--url https://api.example.com/api/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>"
}
'{
"message": "<string>",
"accessToken": "<string>",
"refreshToken": "<string>",
"user": {
"id": "<string>",
"email": "<string>",
"nombre": {},
"apellido": {},
"telefono": {},
"email_verified": true,
"tour_version": {},
"tour_completed_at": {}
},
"error": "<string>"
}Authentication
Login
Authenticate a user and obtain access tokens
POST
/
api
/
auth
/
login
Login
curl --request POST \
--url https://api.example.com/api/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"password": "<string>"
}
'{
"message": "<string>",
"accessToken": "<string>",
"refreshToken": "<string>",
"user": {
"id": "<string>",
"email": "<string>",
"nombre": {},
"apellido": {},
"telefono": {},
"email_verified": true,
"tour_version": {},
"tour_completed_at": {}
},
"error": "<string>"
}Authenticates a user with email and password credentials. Returns access and refresh tokens for subsequent authenticated requests.
400 Bad Request
Authentication
No authentication required.Request Body
User’s registered email address.
User’s password.
Response
Success message confirming authentication.
JWT access token for authenticating API requests. Include this in the
Authorization header as Bearer {accessToken}.JWT refresh token for obtaining new access tokens when they expire.
The authenticated user’s information.
Unique user identifier.
User’s email address.
User’s first name.
User’s last name.
User’s phone number.
Email verification status.
Version of the product tour completed by the user.
Timestamp when the tour was completed.
Example Request
curl -X POST https://api.contafy.com/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "usuario@ejemplo.com",
"password": "SecurePass123!"
}'
Example Response
{
"message": "Inicio de sesión exitoso",
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "usr_1a2b3c4d5e6f7g8h",
"email": "usuario@ejemplo.com",
"nombre": "Juan",
"apellido": "Pérez",
"telefono": "+52 55 1234 5678",
"email_verified": true,
"tour_version": "v1.0",
"tour_completed_at": "2024-01-15T10:30:00Z"
}
}
Error Responses
Error type identifier.
Human-readable error message.
Common Errors
401 Unauthorized{
"error": "INVALID_CREDENTIALS",
"message": "Email o contraseña incorrectos"
}
{
"error": "VALIDATION_ERROR",
"message": "Email y contraseña son requeridos"
}
⌘I