Create an SMS
This endpoint creates an SMS message in Design Studio. After you create an SMS, link it to a workflow. If you make updates after linking the message, make sure you publish changes to send the latest content to your audience.
Not all accounts are set up to create SMS through Design Studio. Learn more about your options.
- Type: stringcontentmin length:1required
The message, written as SMS markup. Put your message text in an
<x-sms-body>element inside an<x-sms>element; the text can include liquid. To send an image as an MMS, add an<x-sms-media>element inside<x-sms>withtype="image"and anhrefset to the image URL or to liquid that resolves to one. Each message can have one image. See SMS building blocks for line breaks, special characters, and the HTML you can't use. - Type: stringnamemin length:1max length:191required
A friendly name for the SMS. Your team sees this name in Design Studio, so pick one that helps them find the message.
- Type: string | null Format: uuidparent
_folder _id UUID of the folder to create the SMS in. Omit or pass
nullto create the SMS at the root level. You can list folders to find the UUID of the folder you want. - Type: stringrecipient
Liquid that resolves to the phone number of the person you're messaging, like
{{customer.phone}}. Customer.io evaluates it against that person's profile when it sends the message. If you leave it empty, Customer.io uses{{customer.phone}}. Don't set a static phone number here; if you do, every send of this message goes to that one number instead of to each person. - Type: integer | null Format: int64sender
_id The ID of the sender identity to send the SMS from. You can list sender identities to find the ID you want. You can create an SMS without a sender, but you need to set one before you can publish it.
- application/json
- application/json
- application/json
- application/json
- application/json
{
"content": "<x-sms><x-sms-body>Hi {{customer.first_name}}, your order has shipped.</x-sms-body><x-sms-media type=\"image\" href=\"https://example.com/order.png\"/></x-sms>",
"name": "Order shipped",
"parent_folder_id": null,
"recipient": "{{customer.phone}}",
"sender_id": 2
}
{
"sms": {
"content": "<x-sms><x-sms-body>Hi {{customer.first_name}}, your order has shipped.</x-sms-body></x-sms>",
"created": 1790000000,
"id": "123e4567-e89b-12d3-a456-426614174000",
"is_linked": true,
"name": "Order shipped",
"parent_folder_id": null,
"recipient": "{{customer.phone}}",
"sender_id": 2,
"updated": 1790000000
}
}SMS created