Authentication
Browser sessions
Sign in at the relevant dashboard (publisher / advertiser / admin). Cookies and short-lived JWTs are issued automatically; the SDK clients in our docs all use them.
# 1. Sign in (browser flow returns httpOnly cookies; here we use JSON)
curl -fsS https://api.mpwa.to/v1/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"you@example.com","password":"..."}'
# → { "accessToken": "eyJ…", "refreshToken": "..." }
# 2. Use the access token on subsequent calls (15 min lifetime)
curl -fsS https://api.mpwa.to/v1/reports/overview \
-H "Authorization: Bearer eyJ…"Server-to-server (API keys)
Generate an API key in Settings → API Keys. Pass it as the Bearer token. Keys are scoped to the issuing user's role and respect the same RBAC.
# Generate a key in Settings → API Keys, then:
curl -fsS https://api.mpwa.to/v1/campaigns \
-H "Authorization: Bearer mpk_live_..."Rate limits
Default 2000 req/min per user/key. Login + signup are tighter (10/min and 5/min). Bursts return 429 with a Retry-After header.