Send an SMS or MMS directly without a template. Requires `type` and `to`. Pass `message` and/or `mediaUrls`. Optional: `from`, `schedule`.
const url = 'https://api.pingram.io/sms';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"type":"example","to":"example","message":"example","mediaUrls":["example"],"schedule":"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 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "type": "example", "to": "example", "message": "example", "mediaUrls": [ "example" ], "schedule": "example", "from": "example" }'Authorizations
Request Bodyrequired
Request body for POST /sms (send SMS or MMS without a template).
object
The notification type to send.
The phone number of the recipient.
The message of the SMS or MMS notification. Optional when mediaUrls is provided.
Public HTTPS URLs of media to attach (MMS).
The ISO 8601 datetime to schedule the SMS notification.
Override the sender phone number. Must be a dedicated number on your Pingram account.
Examplegenerated
{ "type": "example", "to": "example", "message": "example", "mediaUrls": [ "example" ], "schedule": "example", "from": "example"}Responses
200
Successful response
Success response for POST /sms.
object
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" }}