Authentication
Two authentication modes depending on your use case: server integration (API key) or dashboard (JWT).
Authentication modes
| Mode | Usage | Header |
|---|---|---|
| API key | Event ingestion, customers, webhooks | X-API-Key |
| JWT | Dashboard, billing, settings, campaigns | Authorization: Bearer |
| Public | Health, register, login, plans | — |
API key (integration)
Protected prefixes: /events, /customers, /churn, /webhooks.
curl https://zedchurn.fr/api/v1/events \
-H "X-API-Key: api_zedcheckout_xxxxxxxx"JWT (dashboard)
After POST /auth/login, the token is available via the auth_token cookie (httpOnly, secure, SameSite=Lax) or Bearer header.
// Cookie automatique depuis le BFF Next.js
// Ou explicitement :
fetch('/api/v1/dashboard/customers', {
headers: { Authorization: 'Bearer <access_token>' },
credentials: 'include',
});TOTP 2FA is required when enabled — provide totp_code at login if active.