Skip to main content
POST
/
api
/
auth
/
login
Login con email y contraseña
curl --request POST \
  --url https://api.raul.ugps.io/api/auth/login \
  --header 'Content-Type: application/json' \
  --data '
{
  "username": "user@example.com",
  "password": "password123"
}
'
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.access.token",
  "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.refresh.token",
  "user": {
    "id": "6f0a0d6d-4e2e-4d97-8ef9-8b1dd9d0b123",
    "email": "admin@ugps.cl",
    "nombre": "Administrador Raul",
    "rol": "admin",
    "avatar_url": "/uploads/avatars/user-admin.jpg"
  }
}

Body

application/json
username
string
required

Email del usuario

Example:

"user@example.com"

password
string
required

Contraseña del usuario

Example:

"password123"

Response

Login exitoso

token
string
required

JWT access token

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.access.token"

refresh_token
string
required

Refresh token

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.refresh.token"

user
object
required

Datos del usuario