v1.0.0
OpenAPI 3.1.0

Create a WhatsApp template

US region

Client Libraries

Create a WhatsApp template

​

This endpoint creates a WhatsApp template in Design Studio. Creating a template doesn't send anything to Meta. Before you can send the template to your audience, you need to submit it to Meta for approval, and Meta needs to approve it.

You write the template's content as WhatsApp markup, a set of elements that match the components you can add in Design Studio. See WhatsApp building blocks for every element and the rules the markup follows.

Make sure the template's content, category, and language are right before you submit it. After you submit a template, you can't change those fields unless Meta rejects it.

Body
required
application/json
  • category
    Type: string enum
    required

    The Meta template category. Use MARKETING for promotional content and UTILITY for non-promotional messages about a transaction, like an order update. You can't create Authentication templates in Design Studio. Learn more about template categories in Meta's docs.

    values
    • MARKETING
    • UTILITY
  • content
    Type: string
    min length:  
    1
    required

    The template, written as WhatsApp markup. Put your message text in an <x-wa-body> element inside an <x-whatsapp> element; the text can include liquid. You can also add a header or header media, a footer, and buttons. See WhatsApp building blocks for every element.

  • language
    Type: string
    min length:  
    1
    required

    The Meta language code for the template, like en_US. You need to create a separate template for each language you want to support.

  • name
    Type: string
    min length:  
    1
    max length:  
    191
    required

    A friendly name for the template. Your team sees this name in Design Studio, so pick one that helps them find the template. Customer.io also uses it as the basis for the template name it gives Meta when you submit the template.

  • recipient
    Type: string
    min length:  
    1
    required

    Liquid that resolves to the WhatsApp 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. Don't set a static phone number here; if you do, every send of this template goes to that one number instead of to each person.

  • parent_folder_id
    Type: string | null Format: uuid

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

  • sender_id
    Type: integer | null Format: int64
    min:  
    1

    The ID of the WhatsApp sender identity to send the template from. You can list sender identities to find the ID you want. The sender must be a WhatsApp sender, not an SMS or email sender.

Responses
  • application/json
  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/v1/design_studio/whatsapp
{
  "category": "UTILITY",
  "content": "<x-whatsapp><x-wa-body>Hi {{customer.first_name}}, your order has shipped.</x-wa-body></x-whatsapp>",
  "language": "en_US",
  "name": "Order shipped",
  "recipient": "{{customer.phone}}",
  "parent_folder_id": null,
  "sender_id": 4
}
{
  "whatsapp": {
    "category": "UTILITY",
    "content": "<x-whatsapp><x-wa-body>Hi {{customer.first_name}}, your order has shipped.</x-wa-body></x-whatsapp>",
    "created": 1790000000,
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "is_linked": true,
    "is_template": true,
    "language": "en_US",
    "name": "Order shipped",
    "parent_folder_id": null,
    "recipient": "{{customer.phone}}",
    "sender_id": 4,
    "status": "APPROVED",
    "updated": 1790000000
  }
}