Analytics
List top contacts by message volume
Returns the contacts your organization exchanged the most messages with over the selected date range.
GET
Returns the contacts your organization exchanged the most messages with over the selected date range. sortBy chooses the traffic messageCount reports and ranks by: sent counts outbound messages addressed to the contact, received counts inbound messages the contact sent you, and total (the default) counts both. Contacts with no traffic in the range are omitted, and at most 100 are returned.
apiKeyheader
x-api-key<token>after?stringbefore?stringlimit?|nullsortBy?stringValue in
"sent""received""total"Success
application/json- response
[index: integer]?import { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.analytics.getTopContacts({});Example Response
[ { "id": "string", "name": "string", "email": "string", "phone": "string", "messageCount": 0 }]