POST /v1/automations
const url = 'https://seu-endereco-da-api/v1/automations';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"modelSlug":"example","name":"example","channelId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","segmentId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","triggerParams":{},"message":{"kind":"template","templateId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","templateVariables":["example"],"headerMediaKey":"example","headerMediaMime":"example","text":"example"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://seu-endereco-da-api/v1/automations \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "modelSlug": "example", "name": "example", "channelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "segmentId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "triggerParams": {}, "message": { "kind": "template", "templateId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "templateVariables": [ "example" ], "headerMediaKey": "example", "headerMediaMime": "example", "text": "example" } }'Permissão que a Chave de acesso precisa: Gerenciar disparos automáticos (automations:manage).
Authorizations
Seção intitulada “Authorizations”Request Bodyrequired
Seção intitulada “Request Bodyrequired”object
object
object
object
Responses
Seção intitulada “Responses”object
The recipe the automation was created from
Null means the whole reachable base of the account
object
How many contacts the audience held when it was last counted
When that count was taken
Slug of the library model the automation came from
Objective of the library model, null when the model states none
Whether the number sends through the official WhatsApp API
When it goes out next; null while the automation is a draft or paused
True once somebody changed the flow in the builder, so the screen stopped writing over it
Null when the message is free text
The free text sent on numbers that are not official
Null on automations that start from an event
object
The account’s business timezone, resolved when the automation was saved
Local time of day, HH:MM
0 is Sunday
1 to 12, only on a yearly schedule
0 to 365, only on the date of each person
The trigger parameters the automation was saved with; null on those created before models
object
The answer given to when the send goes out
The contact date field the send follows: each person’s own date, or the window a cadence cuts the audience by
Example
{ "status": "rascunho", "channelKind": "oficial", "schedule": { "scheduleKind": "once" }, "when": "na_data_de_cada_pessoa"}