v1.0.0
OpenAPI 3.1.0

Create an SMS

US region

Client Libraries

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.

Body
required
application/json
  • content
    Type: string
    min length:  
    1
    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.

  • name
    Type: string
    min length:  
    1
    max length:  
    191
    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_id
    Type: string | null Format: uuid

    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.

  • recipient
    Type: string

    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_id
    Type: integer | null Format: int64

    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.

Responses
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/v1/design_studio/sms
{
  "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
  }
}