Stannp | Direct Mail Marketing Platform
package icon
Choose the right postage when sending on the API Are you sending personal information, or marketing content? Before you send your mail, know the key difference between First-Class and USPS Marketing Mail. Read our blog to find out more.

Send an SMS

Use the API to send an SMS message to a recipient's mobile device.

[POST]
https://api-us1.stannp.com/v1/sms/create

Parameters

ParameterDetailsDescription
test
bool optional
If set to true, the SMS message will not be sent and there will be no charge.
phone_number
str optional
The recipient's phone number. Required if recipient_id is not provided.
recipient_id
int optional
ID of a recipient that has already been added to your account. Required if phone_number is not provided.
message
str required
The message to be sent. You can use template tags if using recipient_id (e.g., Hi {firstname}).
country
str optional
A 2-character country code (e.g., US, CA, GB). Defaults to your account region.

Request Example

        curl "https://api-us1.stannp.com/v1/sms/create" \
-u {API_KEY}: \
-d "phone_number=12345678901" \
-d "message=Hello World"
    

Response Example

{
  "success": true,
  "data": {
    "id": 0,
    "recipient_id": 0,
    "phone_number": "01234567890",
    "from": "STANNP",
    "profile_id": 3,
    "usage_campaign_id": 0,
    "profile_type": "sender_id",
    "message": "Hello World",
    "message_parts": 1,
    "cost": 0.002,
    "destination_country": "US",
    "status": "test",
    "campaign_id": 0,
    "created": "2024-07-25T16:16:28+00:00",
    "updated": ""
  }
}