Skip to main content
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>"
}
'
{
  "200": {},
  "400": {},
  "401": {},
  "token": "<string>",
  "tipo": "<string>"
}

Request

Authenticate an existing user with their email and password. Returns a JWT token for subsequent authenticated requests.

Body Parameters

email
string
required
User’s email address
password
string
required
User’s password

Request Example

curl -X POST http://localhost:8080/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "securePassword123"
  }'
{
  "email": "[email protected]",
  "password": "securePassword123"
}

Response

token
string
JWT authentication token
tipo
string
Token type (always “Bearer”)

Response Example

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "tipo": "Bearer"
}

Status Codes

200
OK
Successfully authenticated. Returns JWT token.
400
Bad Request
Invalid credentials. Incorrect password provided.Error Message: “Contraseña incorrecta”
401
Unauthorized
User not found with the provided email address.Error Message: “Usuario no encontrado”

Usage

After successful login, include the token in subsequent requests:
curl -X GET http://localhost:8080/api/resource \
  -H "Authorization: Bearer YOUR_TOKEN_HERE"

Build docs developers (and LLMs) love