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.

post/v1/design_studio/sms

Request

  • Base URL
    https://api.customer.io
  • URL
    https://api.customer.io/v1/design_studio/sms
  • Auth
    none declared

Request body

namestring required

A friendly name for the SMS. Your team sees this name in Design Studio, so pick one that helps them find the message.

parent_folder_idstring uuid nullable

UUID of the folder to create the SMS in. Omit or pass null to create the SMS at the root level. You can list folders to find the UUID of the folder you want.

contentstring required

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> with type="image" and an href set 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.

recipientstring

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.

sender_idinteger nullable

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.

Example request

{
  "name": "Order shipped",
  "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>",
  "recipient": "{{customer.phone}}",
  "sender_id": 2
}

Response

SMS created

Example response

{
  "sms": {
    "name": "Order shipped",
    "content": "<x-sms><x-sms-body>Hi {{customer.first_name}}, your order has shipped.</x-sms-body></x-sms>",
    "recipient": "{{customer.phone}}",
    "sender_id": 2,
    "created": 1790000000,
    "updated": 1790000000
  }
}

Changes