This guide covers all aspects of authentication with the Lilith Platform API.
API Keys#
API keys are required for all requests. Contact api@lilith.com to obtain your API key.
Bearer Token Authentication#
Include your API key in the Authorization header:
http
Authorization: Bearer YOUR_API_KEY
JWT Tokens#
For enhanced security, we support JWT-based authentication with these features:
- Short-lived access tokens (15 minutes)
- Refresh token rotation
- Multi-factor authentication (MFA)
- Device fingerprinting
Authentication Endpoints#
Sign In#
bash
curl -X POST "https://api.lilith.com/v1/auth/signin" \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "your-password",
"rememberMe": false
}'
Refresh Token#
bash
curl -X POST "https://api.lilith.com/v1/auth/refresh" \
-H "Content-Type: application/json" \
-d '{
"refreshToken": "your-refresh-token"
}'
Security Best Practices#
- Never expose API keys in client-side code
- Use HTTPS for all API requests
- Implement proper token storage
- Regularly rotate API keys