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>"
}
'
{
  "token": "<string>"
}

Authentication

This endpoint does not require authentication. Use the returned token for subsequent authenticated requests.

Request Body

Email
string
required
User’s email address
Password
string
required
User’s password (sent as plain text, ensure HTTPS is used)

Request Example

{
  "Email": "[email protected]",
  "Password": "miPassword123"
}

Response

token
string
JWT token for authentication. Include this in the Authorization header as Bearer {token} for protected endpoints.

Success Response (200 OK)

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Error Response (401 Unauthorized)

{
  "message": "E mail o contrasena incorrectos"
}

Code Example

curl -X POST https://api.huellitas.com/api/Auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "Email": "[email protected]",
    "Password": "miPassword123"
  }'
const response = await fetch('https://api.huellitas.com/api/Auth/login', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    Email: '[email protected]',
    Password: 'miPassword123'
  })
});

const data = await response.json();
console.log(data.token);

Source Reference

Controller: Huellitas.API/Controllers/AuthController.cs:18 DTO: Huellitas.Core/DTO/Auth/LoginDto.cs

Build docs developers (and LLMs) love