cURL
curl --request POST \ --url https://api.example.com/api/auth/login \ --header 'Content-Type: application/json' \ --data ' { "email": "<string>", "password": "<string>" } '
{ "success": true, "data": { "token": "<string>", "user": { "id": "<string>", "email": "<string>", "display_name": {}, "role": "<string>", "created_at": "<string>" } }, "error": { "code": 123, "message": "<string>" } }
Authenticate with email and password to receive a session token
Show properties
curl -X POST https://api.heimdall.example/api/auth/login \ -H "Content-Type: application/json" \ -d '{ "email": "[email protected]", "password": "securepassword123" }'
{ "success": true, "data": { "token": "7a3f9c2e1b5d8a4c6e9f2b3a7c1d5e8f9a2b4c6d8e1f3a5b7c9d2e4f6a8b1c3d5e7f9", "user": { "id": "123e4567-e89b-12d3-a456-426614174000", "email": "[email protected]", "display_name": "John Doe", "role": "user", "created_at": "2026-03-12T10:30:00Z" } } }
{ "success": false, "error": { "code": 400, "message": "Validation failed: password: Password is required" } }
{ "success": false, "error": { "code": 401, "message": "Invalid email or password" } }
{ "success": false, "error": { "code": 500, "message": "Internal server error" } }