Alerts API
Overview
Endpoints for managing user email subscriptions to Trust Score changes and other
events. Base path: /api/alerts
🔔 Subscriptions
Subscribe to Alerts
POST /api/alerts/subscribe
Subscribe to notifications for a specific company or crypto project.
Body:
{
"email": "user@example.com",
"entity_type": "company", // or "crypto"
"entity_slug": "volkswagen",
"alert_types": ["score_change"]
}
Alert Types:
score_change: Triggered when Trust Score changes significantlyunlock_event: Triggered before token unlocks (crypto only)
Unsubscribe
POST /api/alerts/unsubscribe
Stop receiving alerts for a specific entity.
Body:
{
"email": "user@example.com",
"entity_type": "company",
"entity_slug": "volkswagen"
}
Get My Subscriptions
GET /api/alerts/subscriptions
List all active subscriptions for an email address.
Parameters:
email: User email address
🛠️ System & Testing
Send Test Alert
POST /api/alerts/test
Triggers a test email to verify SMTP configuration (Admin/Debug only).
Parameters:
email: Target emailentity_name: Name to use in template (default: Bitcoin)
Health Check
GET /api/alerts/health
Returns the status of the email service.
Response:
{
"status": "healthy",
"email_configured": true,
"smtp_host": "smtp.gmail.com"
}