curl --request PUT \
--url https://api.ararahq.com/v1/automations/{id}/active \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"active": true
}'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({active: true})
};
fetch('https://api.ararahq.com/v1/automations/{id}/active', 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}/active"
payload = { "active": True }
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}/active",
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([
'active' => true
]),
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
}Ligar ou desligar automação
O teto de automações ativas do plano é conferido aqui, não na criação,
e ignora a própria automação. Automação sem passos não liga
(400 AUTOMATION_EMPTY). Desligar não derruba quem já está no meio da
sequência, só impede gente nova de entrar.
Permissão: AUTOMATIONS_MANAGE.
curl --request PUT \
--url https://api.ararahq.com/v1/automations/{id}/active \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"active": true
}'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({active: true})
};
fetch('https://api.ararahq.com/v1/automations/{id}/active', 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}/active"
payload = { "active": True }
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}/active",
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([
'active' => true
]),
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
true liga, false desliga.
Response
Automação com o novo estado
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