Template guidelines
The source file must be created following these specifications:File format
Only files with the.CSV extension are supported.
Header
The first row of the file must define the column names (header). Follow these rules for the header:- Avoid blank spaces in column names.
- Do not use special characters or punctuation marks (e.g.,
!, $, %, &, *, etc.). - Use only letters, numbers, and underscores (
_) if necessary.
phone_number, customer_name, order_amount
Incorrect: phone number, customer-name!, order#amount
First column
The first column must contain each recipient’s identifier: a phone number or a BSUID. For phone numbers, it is mandatory to include the international code without the+ symbol (for example, for a number in Ecuador, write PHONE_NUMBER).
BSUID cannot be used to send AUTHENTICATION (OTP) templates; that recipient must be sent as a phone number. If a row with a BSUID targets an AUTHENTICATION template, that row is skipped from the send without affecting the rest of the file.
Remaining columns
The other columns will be used for the dynamic values of the parameters (template personalization).Example
If your template contains the following content:The CSV file must be encoded in UTF-8.
Send HSM from file
File upload options
There are two ways to provide the CSV file with recipient information:- Using a public URL: You can provide the URL to the CSV file that is publicly available. In this case, the request body must be in JSON format.
-
Uploading the file: Alternatively, you can attach the CSV file directly to the request. In this case, the request body must be in
multipart/form-dataformat.
Body parameters
Request examples
By file upload method
Send from public URL (JSON)
Send from public URL (JSON)
Send with attached file (multipart/form-data)
Send with attached file (multipart/form-data)
By template type
Each example uses a CSV file published atfileUrl whose columns match the ones listed in params.
Text
Text
Template:
Hi {{1}}, your order {{2}} is on its way.Image
Image
Video
Video
Document
Document
Carousel
Carousel
Each card defines its own media asset in
mediaUrl and its buttons in buttonParameters. The cardIndex field indicates which card each button belongs to, starting at 0.By scenario
These examples show the JSON request body. Send it to the same endpoint with theContent-Type: application/json header.
Header parameter
Header parameter
For templates with a variable in the text header, set the CSV column in
headerParameters.Route the reply to a workflow
Route the reply to a workflow
With
actions.setSkill, the recipient’s reply is routed to the specified workflow.Save CSV data to memory and CRM
Save CSV data to memory and CRM
Use
{column_name} as the value to take the data from that CSV column. setMemoryParams saves the values in the user memory, and crmParams saves them in CRM fields.Scheduled send
Scheduled send
Use
date to schedule the campaign for a date and time in UTC.Send responses
200 - Successful response
200 - Successful response
400 - Bad Request
400 - Bad Request
422 - Unprocessable Entity
422 - Unprocessable Entity
params structure
Each element in theparams array is an object that contains:
- param: Parameter number in the template (1, 2, 3…).
- column: Name of the column in the CSV file from which values will be extracted.
headerParameters uses the same structure, but accepts only one element.
buttonParameters structure
Each element in the array configures one template button. Quick reply (QUICK_REPLY):
- payload.type: Button target.
edgetriggers a workflow andflowtriggers a flow. - payload.action: Button text. Must match the text defined in the template.
- payload.skillId: ID of the workflow to trigger. Required when
payload.typeisedge. - payload.flowId: ID of the flow to trigger. Required when
payload.typeisflow. - payload.cardIndex: Position of the card the button belongs to, starting at
0. Carousels only.
URL):
- param: Number of the URL parameter in the template.
- payload.param: CSV column with the value that completes the URL.
cards structure
Each carousel card is an object with:- mediaUrl: Public URL of the card image or video.
- params: Card body parameters, with the same structure as
params. Use an empty array if the card has no parameters. - buttonParameters: Card buttons. Each
payloadmust includecardIndex.