Group texts
A group text is one message for 3 to 9 participants: the number on your account, plus 2 to 8 other numbers in the United States or Canada. It uses the MMS protocol, so the same chat works on iPhone and Android. A later text to the same numbers stays in that chat on their phones.
One-to-one texts stay on POST /sms.
The account sends from a number it owns. The shared number cannot send a group text. When you omit from, a number on the account is used.
Send
POST /sms/group, or sms.sendGroup in the SDK.
await pingram.sms.sendGroup({ type: 'onboarding', to: ['+14165550100', '+16045550100'], message: 'Welcome to the project chat.', subject: 'Project chat'});| Field | Details |
|---|---|
type |
Notification type for filtering and analytics. For example, onboarding or threshold_alert. |
to |
Two to eight mobile numbers in the US or Canada, in E.164. Include each number only once. |
message |
Text to send. Required when mediaUrls is omitted. |
subject |
Optional. Shown with the group text. |
mediaUrls |
Optional public HTTPS URLs of pictures or files. |
from |
Optional. A number on this account. |
The response is a tracking id, the same shape as a one-to-one text. A follow-up is another send to the same numbers. Each send has its own tracking id. Group texts cannot be scheduled.
If one number has texted STOP, the whole group text is rejected. The error code is GROUP_RECIPIENT_UNSUBSCRIBED, and the message names that number when it is known. Remove the number, or ask them to text START, then send again.
Each recipient is billed at the multimedia message rate, including a text with no attachment. The cost counts toward the texting budget.
Notification preferences are not applied. A recipient who turned this notification type off still receives the group text.
Delivery
Turn these events on from the Webhooks page. Payloads are also listed under Events Webhook.
GROUP_TEXT_DELIVERED is sent once for each number that receives the text. The first of those marks the group text delivered. recipient is that number. participants is the numbers the text was sent to, in that order. The number on your account is from, and is not included there.
GROUP_TEXT_FAILED means the send itself was rejected. A handset failure after the text is accepted does not fail the group. A recipient who texted STOP rejects the whole send, and failureCode is GROUP_RECIPIENT_UNSUBSCRIBED. Other send failures use GROUP_SEND_FAILED.
Replies
When someone types in a group that includes a number on your account, you receive GROUP_TEXT_INBOUND. It is not tied to an earlier send. Each account that owns an active number in the group gets that message.
STOP and START stay SMS_UNSUBSCRIBE and SMS_SUBSCRIBE. from is the number that texted. They do not also send GROUP_TEXT_INBOUND.
Logs
Group texts have their own log, separate from one-to-one texts. On Logs, Group Text Logs appears under the filter card once this account has at least one. That opens its own page. The only filter is tracking id.
GET /logs/group-textslists them, newest first.GET /logs/group-texts/{trackingIds}loads rows by tracking id.
They are not on GET /logs/{trackingIds} or GET /logs/status/{trackingIds}.