Send a group text
const url = 'https://api.pingram.io/sms/group';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"example","to":["example"],"message":"example","subject":"example","mediaUrls":["example"],"from":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pingram.io/sms/group \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "example", "to": [ "example" ], "message": "example", "subject": "example", "mediaUrls": [ "example" ], "from": "example" }'Send one text to 2–8 numbers in the US or Canada. Each recipient is billed at the multimedia message rate. An optional subject is shown with the text. A follow-up is another send to the same numbers.
Authorizations
Request Bodyrequired
Send one text to several numbers at once. Phones keep a later text to the same numbers in the same chat.
object
Notification type you can use later for filtering, analytics, and more. For example, “onboarding” or “threshold_alert”.
Two to eight mobile numbers in the US or Canada. Each number is billed at the multimedia message rate, including a text with no attachment.
Text to send. Required when mediaUrls is omitted.
Subject shown with the group text. Optional.
Public HTTPS URLs of pictures or files to attach.
Number the group text is sent from. When omitted, a number on this account is used.
Examplegenerated
{ "type": "example", "to": [ "example" ], "message": "example", "subject": "example", "mediaUrls": [ "example" ], "from": "example"}Responses
200
Successful response
Success response for POST /sms.
object
Warnings about this send. Empty when the text was accepted.
Error response for POST /sms.
object
Error details for SMS send failures.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "messages": [ "example" ]}400
Bad Request - validation errors, invalid input
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}401
Unauthorized
402
Payment Required - usage limits exceeded
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}500
Internal Server Error
502
Bad Gateway - provider error
Standard error response for API errors.
object
Unique tracking ID for the request.
Structured error details for API error responses.
object
Machine-readable error code.
Human-readable error message.
Actionable hint for fixing the error.
Examplegenerated
{ "trackingId": "example", "error": { "code": "example", "message": "example", "fix": "example" }}