Skip to main content

BroadcastDraft

namestring

Possible values: non-empty and <= 120 characters

phoneNumberIdstringnullable
templateNamestringnullable

Possible values: <= 512 characters

templateLanguagestringnullable

Possible values: >= 2 characters and <= 15 characters

Example: pt_BR
variables objectnullable

Where each template variable comes from: header and body by placeholder ("1", "2"… or the name), buttons by button index. Every contact or field source requires a fallback for whoever lacks the data. A media header needs headerMedia.

header object
property name* VariableSource

contact (a contact detail), attribute (a custom field) or static (a fixed value).

sourcestringrequired

Possible values: [contact, attribute, static]

keystring
Example: first_name
fallbackstring

Possible values: non-empty and <= 200 characters

valuestring

Possible values: non-empty and <= 1000 characters

body object
property name* VariableSource

contact (a contact detail), attribute (a custom field) or static (a fixed value).

sourcestringrequired

Possible values: [contact, attribute, static]

keystring
Example: first_name
fallbackstring

Possible values: non-empty and <= 200 characters

valuestring

Possible values: non-empty and <= 1000 characters

buttons object
property name* VariableSource

contact (a contact detail), attribute (a custom field) or static (a fixed value).

sourcestringrequired

Possible values: [contact, attribute, static]

keystring
Example: first_name
fallbackstring

Possible values: non-empty and <= 200 characters

valuestring

Possible values: non-empty and <= 1000 characters

headerMedia object
typestring

Possible values: [image, video, document]

linkstring<uri>

Possible values: <= 2000 characters

idstring

Possible values: <= 100 characters

filenamestring

Possible values: <= 240 characters

audienceIdstringnullable

Saved audience. With both audienceId and audienceFilter, audienceId wins.

audienceFilter objectnullable

An audience condition tree: and/or groups up to 3 levels deep and 30 conditions in total. The valid operators for each field type come from GET /audiences/schema.

opstringrequired

Possible values: [and, or]

rulesobject[]required

Possible values: <= 30

scheduledAtstring<date-time>nullable
timezonestring
Example: America/Sao_Paulo
sendWindow objectnullable

Weekdays (0 = Sunday) and the hours the campaign may send, in the timezone. Outside them it pauses and resumes on its own.

daysinteger[]

Possible values: >= 1, <= 7

startstring

Possible values: Value must match regular expression ^\d{2}:\d{2}$

Example: 09:00
endstring

Possible values: Value must match regular expression ^\d{2}:\d{2}$

Example: 20:00
throttlePerMinuteintegernullable

Sends per minute. Without a value, the platform default.

Possible values: >= 10 and <= 60000

flowIdstringnullable

Flow that answers the template's quick-reply buttons.

BroadcastDraft
{
"name": "string",
"phoneNumberId": "string",
"templateName": "string",
"templateLanguage": "pt_BR",
"variables": {
"body": {
"1": {
"source": "contact",
"key": "first_name",
"fallback": "cliente"
},
"2": {
"source": "static",
"value": "BLACK20"
}
}
},
"audienceId": "string",
"audienceFilter": {
"op": "and",
"rules": [
{
"type": "consent",
"op": "is",
"value": "opted_in"
},
{
"type": "field",
"key": "cidade",
"op": "eq",
"value": "Curitiba"
}
]
},
"scheduledAt": "2024-07-29T15:51:28.071Z",
"timezone": "America/Sao_Paulo",
"sendWindow": {
"days": [
0
],
"start": "09:00",
"end": "20:00"
},
"throttlePerMinute": 0,
"flowId": "string"
}