Skip to main content
Use these payload fields when rendering SMS content. Sounds are not applicable for SMS. Map the fields into your SMS provider template or build the body string in your service before sending.

Payload shapes

Field meanings:
  • to: recipient identifier and phone number.
  • messages[]: unread messages that triggered the SMS; use for counts and previews.
  • senderDetails: most recent sender; helpful for subject-style copy.
  • groupDetails: present for group conversations.
  • smsContent: an optional, ready-to-send string if you want to use it directly.

One-on-one

{
  "to": { "uid": "cometchat-uid-1", "phno": "+919299334134", "name": "Andrew Joseph" },
  "messages": [
    { "sender": { "uid": "cometchat-uid-4", "name": "Susan Marie" }, "message": "Are we meeting on this weekend?" },
    { "sender": { "uid": "cometchat-uid-4", "name": "Susan Marie" }, "message": "📷 Has shared an image" }
  ],
  "senderDetails": { "uid": "cometchat-uid-4", "name": "Susan Marie" },
  "smsContent": "You've received new messages from Susan Marie! Read them at https://your-website.com/chat."
}

Group

{
  "to": { "uid": "cometchat-uid-1", "phno": "+919299334134", "name": "Andrew Joseph" },
  "messages": [
    { "sender": { "uid": "cometchat-uid-5", "name": "John Paul" }, "message": "Hello all! What's up?" },
    { "sender": { "uid": "cometchat-uid-4", "name": "Susan Marie" }, "message": "📷 Has shared an image" }
  ],
  "groupDetails": { "guid": "cometchat-guid-1", "name": "Hiking Group" }
}

Template examples

You can use the provided smsContent field or build your own using senderDetails, groupDetails, and messages.length. Here are default and privacy-focused templates:
Use caseDefault templatePrivacy templateExample result (default)
One-on-one notificationYou’ve received {{messages.length}} message(s) from {{senderDetails.name}}! Read them at https://your-website.com.You’ve received {{messages.length}} message(s) from {{senderDetails.name}}! Read them at https://your-website.com.You’ve received 2 message(s) from Susan Marie! Read them at https://your-website.com.
Group notificationYou’ve received {{messages.length}} message(s) in {{groupDetails.name}}! Read them at https://your-website.com.You’ve received {{messages.length}} message(s) in {{groupDetails.name}}! Read them at https://your-website.com.You’ve received 2 message(s) in Hiking Group! Read them at https://your-website.com.