Organization API
Self-service organization (tenant) endpoints. Authentication is cookie-based after login; admin endpoints require an admin JWT.
Authentication
POST /api/tenant/register— Create organization (returns verification link in dev).POST /api/tenant/verify-email— Verify email with token.POST /api/tenant/resend-verification— Resend verification link.POST /api/tenant/login— Tenant login (sets session cookie).GET /api/tenant/me— Current tenant/user info.POST /api/tenant/logout— Logout.
Messaging
POST /api/tenant/send-sms— Send SMS (body: to, message, sender_id?, client_id?).POST /api/tenant/whatsapp/send— Send WhatsApp text (body: to, message, client_id?).GET /api/tenant/logs— SMS delivery logs.GET /api/tenant/whatsapp/logs— WhatsApp delivery logs.GET /api/tenant/whatsapp/status/{message_id}— WhatsApp message status.
Account & Billing
GET /api/tenant/clients— List API clients.POST /api/tenant/clients/create— Create API client.POST /api/tenant/clients/{client_id}/regenerate-secret— Rotate secret.GET /api/tenant/usage— Usage statistics.GET /api/tenant/billing— Billing info.POST /api/tenant/upgrade-request— Request plan upgrade.GET /api/tenant/plans— Available plans.
Admin-only tenant management endpoints are available under /api/tenant/admin/api/tenants and require an admin JWT.