Reference

Contacts

Contacts are the people known to the linked number.

Tusk WhatsApp API: Contacts

List contacts

GET/v1/whatsapp/sessions/{sessionId}/contacts

Returns the contacts of the session.

Parameters
NameTypeDescription
sessionIdrequiredpathThe session id from the sessions endpoints.
limitintegerMaximum contacts to return, from 1 to 1000. Defaults to 1000.
offsetintegerNumber of contacts to skip, for paging.
curl "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/contacts?limit=50" \
  -H "X-API-Key: $TUSK_WA_KEY"
200 OK
[
  {
    "id": "[email protected]",
    "name": "Amina Wanjiru",
    "pushName": "Amina",
    "number": "254700000002",
    "isMyContact": true,
    "isBlocked": false
  }
]

Check a number

GET/v1/whatsapp/sessions/{sessionId}/contacts/check/{number}

Checks whether a phone number is on WhatsApp. Limited to 30 checks per minute per session.

Parameters
NameTypeDescription
sessionIdrequiredpathThe session id from the sessions endpoints.
numberrequiredpathThe number in international format, without a plus.
curl "https://api.tuskmail.africa/v1/whatsapp/sessions/$SESSION_ID/contacts/check/254700000002" \
  -H "X-API-Key: $TUSK_WA_KEY"
200 OK
{
  "number": "254700000002",
  "exists": true,
  "chat_id": "[email protected]"
}