Skip to main content
POST
/
auth
/
login
Login
curl --request POST \
  --url https://api.example.com/auth/login \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "<string>",
  "password": "<string>",
  "type": "<string>"
}
'
{
  "accessToken": "<string>",
  "refreshToken": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/4rt21/backend-proyecto/llms.txt

Use this file to discover all available pages before exploring further.

Authenticates a user and returns access and refresh tokens.

Request Body

email
string
required
User’s email address. Must be a valid email format.Example: user@example.com
password
string
required
User’s password.Example: password
type
string
required
Login type. Must be either web or mobile. Determines which role is allowed to access.
  • web: Allows users with role_id 2
  • mobile: Allows users with role_id 1
Example: web

Response

accessToken
string
JWT access token used for authenticated requests. Valid for 1 hour.
refreshToken
string
JWT refresh token used to obtain new access tokens. Valid for 7 days.

Example Request

curl -X POST https://api.falconalert.com/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "password",
    "type": "web"
  }'

Example Response

{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwidHlwZSI6ImFjY2VzcyIsInByb2ZpbGUiOnsiaWQiOiIxIiwiZW1haWwiOiJhcnR1cm9AZ21haWwuY29tIiwibmFtZSI6IkFydHVybyBVdHJpbGxhYSDDiURJVCIsInJvbGVfaWQiOjF9LCJpYXQiOjE3NjEyOTI0MTEsImV4cCI6MTc2MTI5NjAxMX0.ECBWVGu-tXr7Shs9qvg9LMISOXtFQmp3R8C5Uk8cUuw",
  "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxIiwidHlwZSI6InJlZnJlc2giLCJpYXQiOjE3NjEyOTI0MTEsImV4cCI6MTc2MTg5NzIxMX0.tA-fCXWmhTzE1YlOXTpftjn_qFzZJoZaCJEPBEYrYZI"
}

Status Codes

CodeDescription
200Login successful. Returns access and refresh tokens.
400Invalid email format or missing required fields.
401Invalid password or user role not allowed for the specified type.
404User with the provided email not found.

Build docs developers (and LLMs) love