Skip to main content

Get SMS Campaign Statistics

Retrieve aggregate SMS delivery and engagement statistics, click breakdowns, link activity, and total charged cost.


Endpoint

GET https://api.campaignlark.com/v1/sms-campaigns/:id/statistics

Path Parameters

ParameterTypeRequiredDescription
idstringrequiredCampaign ID as a MongoDB ObjectID hex string.

Sample Request

GET https://api.campaignlark.com/v1/sms-campaigns/64f1a2b3c4d5e6f7a8b9c0d1/statistics

Response

Success — 200 OK

{
"error": null,
"data": {
"aggregate": {
"sent": 4820,
"delivered": 4600,
"clicked": 412,
"failed": 23,
"unsubscribed": 8,
"suppressed": 189
},
"clicks_by_country": [
{ "country": "US", "click_count": 210 },
{ "country": "GB", "click_count": 85 }
],
"clicks_by_device_type": [
{ "device_type": "Mobile", "click_count": 280 },
{ "device_type": "Desktop", "click_count": 132 }
],
"clicks_by_os": [
{ "operating_system": "iOS", "click_count": 190 },
{ "operating_system": "Windows", "click_count": 95 }
],
"link_activity": [
{
"url": "https://example.com/sale",
"total_clicks": 350,
"unique_clicks": 290
}
],
"total_cost": "12.3456"
}
}

The breakdown arrays count each recipient's first click, matching email campaign statistics. total_cost is the real charged amount derived from the SMS billing ledger.

Statistics Fields

FieldTypeDescription
aggregate.sentintegerNumber of SMS messages sent.
aggregate.deliveredintegerNumber of delivered SMS messages.
aggregate.clickedintegerNumber of recipients who clicked.
aggregate.failedintegerNumber of failed SMS messages.
aggregate.unsubscribedintegerNumber of unsubscribed recipients.
aggregate.suppressedintegerNumber of suppressed recipients.
clicks_by_countryarrayClick counts grouped by country.
clicks_by_device_typearrayClick counts grouped by device type.
clicks_by_osarrayClick counts grouped by operating system.
link_activityarrayTotal and unique clicks grouped by link URL.
total_coststringReal amount charged according to the billing ledger.

Errors

StatusMessageCause
400Please provide a campaign ID.id is missing.
400We could not find the campaign you are looking for.The ID is malformed or the campaign does not exist in the workspace.