Client Tagging
Client Tagging lets you attach a free-form tag to the messages you send, then report on usage and cost grouped by that tag. It’s designed for resellers and multi-tenant applications who send on behalf of their own end clients and need to attribute spend back to each one.
There’s nothing to set up. Tags are created automatically the first time you use them. Just include a clientTag when you send, and the
usage rolls up under that tag in the reporting endpoint.
Tagging your sends
Section titled “Tagging your sends”Pass clientTag when sending a single SMS or an SMS batch.
On a batch, the tag is applied to every message in the request.
await smsClient.SendSmsAsync(new ConnectSmsMessage{ To = "+447700900123", Content = "Your order has shipped!", ClientTag = "acme-corp" // attribute this send to your client "Acme Corp"});await client.sms.send({ to: '+447700900123', content: 'Your order has shipped!', clientTag: 'acme-corp' // attribute this send to your client "Acme Corp"});curl -X POST https://connect-api.divergent.cloud/sms/send \ -H "X-Api-Key: { API_KEY }" \ --json '{ "sender": "{ SENDER_NAME }", "recipient": "{ RECIPIENT_NUMBER }", "content": "{ CONTENT }", "clientTag": "acme-corp" }'How tags are normalized
Section titled “How tags are normalized”To keep tags consistent and reportable, every tag you send is normalized before it’s stored:
- Converted to lowercase
- Only
a–z,0–9and hyphens are kept - Any run of other characters (spaces, punctuation, accents) becomes a single hyphen
- Leading and trailing hyphens are trimmed
- Truncated to a maximum of 64 characters
This means "Acme Corp", "acme corp" and "ACME, Corp!" all normalize to the same tag, acme-corp, and report together. If a tag
normalizes to an empty string, it’s treated as no tag at all.
| You send | Stored as |
|---|---|
Acme Corp | acme-corp |
ACME, Corp! | acme-corp |
client_42 | client-42 |
| (no tag) |
Usage Reporting
Section titled “Usage Reporting”Retrieve aggregated usage and cost grouped by tag over a date range.
GET /reporting/client-tag-report
Request Data
Section titled “Request Data”Headers
Query Parameters
Response Data
Section titled “Response Data”JSON Data
Example Response
Section titled “Example Response”{ "dateStart": "2026-05-19", "dateEnd": "2026-06-19", "summaries": [ { "tag": "acme-corp", "sentCount": 1240, "sentPartsCount": 1310, "totalCostEur": 45.85, "totalCostGbp": 39.30, "daily": [ { "date": "2026-06-18", "sentCount": 80, "sentPartsCount": 84, "totalCostEur": 2.94, "totalCostGbp": 2.52 } ] } ]}