curl --request PUT \
--url https://api.ararahq.com/v1/automations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://api.ararahq.com/v1/automations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ararahq.com/v1/automations/{id}"
payload = { "name": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ararahq.com/v1/automations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "3d5a1f0c-6b2e-4c8d-9a41-0e1f2a3b4c5d",
"name": "Lembrete de carrinho",
"trigger": "cart.abandoned",
"triggerConfig": null,
"active": false,
"steps": [
{
"id": "b2f0c1de-1a2b-4c3d-8e4f-5a6b7c8d9e0f",
"type": "wait",
"config": {
"minutes": 60
}
},
{
"id": "c7a1e2d3-4b5c-4d6e-9f70-8a9b0c1d2e3f",
"type": "message",
"config": {
"templateId": "0b8f6c1e-7a52-4a1b-9a0e-3f2d6c9e1a44",
"variables": [
"nome"
]
}
}
],
"costPerRunBrl": 0.38,
"stats": {
"runsLast30Days": 0,
"inFlight": 0,
"completed": 0,
"stopped": 0
},
"webhookUrl": null,
"hook": null
}Atualizar automação
Substitui a automação inteira: nome, gatilho e a lista de passos. Não
existe alteração parcial. Mande o objeto completo, como
GET /v1/automations/{id} devolveu.
Salvar uma automação ligada encerra as execuções que estão esperando
resposta (question) ou pagamento (wait_payment), com
stoppedReason: "automação editada".
Permissão: AUTOMATIONS_MANAGE.
curl --request PUT \
--url https://api.ararahq.com/v1/automations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>'})
};
fetch('https://api.ararahq.com/v1/automations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ararahq.com/v1/automations/{id}"
payload = { "name": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ararahq.com/v1/automations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "3d5a1f0c-6b2e-4c8d-9a41-0e1f2a3b4c5d",
"name": "Lembrete de carrinho",
"trigger": "cart.abandoned",
"triggerConfig": null,
"active": false,
"steps": [
{
"id": "b2f0c1de-1a2b-4c3d-8e4f-5a6b7c8d9e0f",
"type": "wait",
"config": {
"minutes": 60
}
},
{
"id": "c7a1e2d3-4b5c-4d6e-9f70-8a9b0c1d2e3f",
"type": "message",
"config": {
"templateId": "0b8f6c1e-7a52-4a1b-9a0e-3f2d6c9e1a44",
"variables": [
"nome"
]
}
}
],
"costPerRunBrl": 0.38,
"stats": {
"runsLast30Days": 0,
"inFlight": 0,
"completed": 0,
"stopped": 0
},
"webhookUrl": null,
"hook": null
}Authorizations
Chave de API da Arara (ara_live_...), enviada no header Authorization: Bearer ara_live_.... Crie e gerencie as chaves no painel: https://app.ararahq.com/dashboard/apikeys. O valor completo aparece uma única vez, na criação.
Path Parameters
ID da automação.
Body
Nome interno da automação.
Gatilho que coloca um contato na automação. webhook é o link
próprio da automação; cart.abandoned e payment.failed vêm da
recuperação de receita; os demais são eventos internos da Arara.
webhook, cart.abandoned, payment.failed, tag.applied, conversation.started, button.replied, charge.paid, charge.expired Só button.replied exige: { "replyId": "...", "templateName"?: "..." }. Os demais gatilhos ignoram o campo.
Passos, na ordem de execução. A lista inteira é reescrita a cada POST ou PUT.
Show child attributes
Show child attributes
Response
Automação atualizada
false na criação. Mude em PUT /v1/automations/{id}/active.
Show child attributes
Show child attributes
Custo estimado, em reais, de cada pessoa que entrar na automação.
Show child attributes
Show child attributes
URL que o seu sistema precisa chamar, quando o gatilho depende disso.
Só no gatilho webhook.
Show child attributes
Show child attributes