Authentication
Mittr supports two authentication methods. Both can be used simultaneously.
API key
Section titled “API key”Include your API key in any of these locations (checked in order):
X-API-Keyheader (recommended)Authorization: Bearer {key}header?key={key}query parameter (WebSocket only)
curl https://app.mittr.io/api/v1/events \ -H "X-API-Key: mtr_your_key"API keys belong to one workspace and may also be limited to one project. See Project scoping.
Session cookie
Section titled “Session cookie”For browser-based access (dashboard), authenticate via email/password login:
# Login — sets mittr_session cookiecurl -X POST https://app.mittr.io/auth/login \ -H "Content-Type: application/json" \ -c cookies.txt
# Subsequent requests use the cookiecurl https://app.mittr.io/api/v1/events -b cookies.txtSessions expire after 24 hours by default.
Project scoping
Section titled “Project scoping”Every request runs in exactly one project. Which one depends on the credential:
- API key limited to a project (the key created at signup is limited to the default project): requests always run in that project. Sending
X-Project-IDwith any other project returns403. - API key with no project (keys created with
POST /api/v1/api-keysormittr apikey create): sendX-Project-IDto choose a project in your workspace. A project outside your workspace returns403. Without the header, requests run in the default project. - Session cookie: send
X-Project-IDto choose a project. A project outside your workspace is ignored and the request runs in the default project.
curl https://app.mittr.io/api/v1/endpoints \ -H "X-API-Key: mtr_your_key" \ -H "X-Project-ID: your-project-uuid"Deleting a project revokes the API keys limited to it.
Auth flow (CombinedMiddleware)
Section titled “Auth flow (CombinedMiddleware)”The server checks authentication in order:
- Session cookie (
mittr_session) → if valid, authenticated - API key (
X-API-Key/Bearer/?key=) → if valid, authenticated - Neither →
401 Unauthorized
Public endpoints
Section titled “Public endpoints”These endpoints require no authentication:
POST /auth/signup,/auth/login,/auth/verify-emailPOST /auth/forgot-password,/auth/reset-passwordPOST /auth/accept-invitePOST /inbound/{pathSuffix}(inbound webhooks)POST /webhooks/billing/{provider}(provider-signed)GET /health,/health/live,/health/readyGET /docs/,/openapi.yaml,/openapi.json