JavaScript SDK: swarmhit.whatsappAccounts.getStats(whatsappAccountId)
The last 30 days of campaign messages from the number (sent, new chats, answered, delivered, read), today's usage against today's caps, and a 0-100 health score with its reasons.
Authorization
bearerAuth An API key created on the Access tokens page.
In: header
Path Parameters
Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/whatsapp-accounts/string/stats"{ "data": { "last30Days": { "sent": 0, "newChats": 0, "answered": 0, "replyRate": 0, "delivered": 0, "read": 0, "readRate": 0, "byDay": { "property1": 0, "property2": 0 } }, "today": { "newChats": { "used": 0, "limit": 0 }, "followUps": { "used": 0, "limit": 0 }, "checks": { "used": 0, "limit": 0 } }, "health": { "score": 0, "level": "ok", "reasons": [ "string" ] } }}Get a WhatsApp number GET
**JavaScript SDK:** [`swarmhit.whatsappAccounts.get(whatsappAccountId)`](/smart-api/sdk/methods#whatsappAccounts)
Follow a link GET
**JavaScript SDK:** [`swarmhit.whatsappAccounts.getLink(whatsappAccountId)`](/smart-api/sdk/methods#whatsappAccounts) Where a link stands: `pending` with the current checkpoint (the QR changes about every 20 seconds), `expired` (nothing was scanned in time: POST /whatsapp-accounts/{id}/relink), `active` with the number, or `error` with its `code` (`duplicate`: the number is already linked).