Used by the dashboard. Obtain with email + password:
curl -X POST "$PUBLIC_API_URL/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{"email":"admin@example.com","password":"ChangeMe123!"}'
Response:
{
"token": "eyJhbGciOi...",
"user": { "id":"...", "email":"admin@example.com", "role":"admin" }
}
Send subsequent admin requests with:
Authorization: Bearer <token>
The admin JWT controls: account CRUD, webhook CRUD, AI settings, manual replies, browsing all data.
Each WhatsApp account in the dashboard gets its own token (prefix wapi_). The raw token is shown once at creation — store it.
Send WHAPI-style requests with:
Authorization: Bearer wapi_xxxx
These endpoints are scoped to that one account:
GET /api/v1/mePOST /api/v1/messages/textPOST /api/v1/messages/mediaGET /api/v1/chats, /api/v1/chats/:id, /api/v1/chats/:id/messagesGET /api/v1/contacts, /api/v1/groups, /api/v1/channelsPOST /api/v1/ai/chat/testHit POST /api/v1/accounts/:id/token/regenerate (admin JWT). The old token immediately stops working.
ENCRYPTION_KEY.RATE_LIMIT_*.