curl --request POST \
--url https://api.ararahq.com/v1/flows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Captar contato",
"category": "LEAD_GENERATION",
"title": "Fale com a gente",
"fields": [
{
"label": "Seu nome",
"type": "TEXT",
"key": "nome"
},
{
"label": "Seu melhor e-mail",
"type": "EMAIL",
"key": "email"
},
{
"label": "O que você procura?",
"type": "SELECT",
"key": "interesse",
"options": [
"Falar com vendas",
"Suporte",
"Parceria"
]
},
{
"label": "Observações",
"type": "LONG_TEXT",
"key": "obs",
"required": false
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Captar contato',
category: 'LEAD_GENERATION',
title: 'Fale com a gente',
fields: [
{label: 'Seu nome', type: 'TEXT', key: 'nome'},
{label: 'Seu melhor e-mail', type: 'EMAIL', key: 'email'},
{
label: 'O que você procura?',
type: 'SELECT',
key: 'interesse',
options: ['Falar com vendas', 'Suporte', 'Parceria']
},
{label: 'Observações', type: 'LONG_TEXT', key: 'obs', required: false}
]
})
};
fetch('https://api.ararahq.com/v1/flows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ararahq.com/v1/flows"
payload = {
"name": "Captar contato",
"category": "LEAD_GENERATION",
"title": "Fale com a gente",
"fields": [
{
"label": "Seu nome",
"type": "TEXT",
"key": "nome"
},
{
"label": "Seu melhor e-mail",
"type": "EMAIL",
"key": "email"
},
{
"label": "O que você procura?",
"type": "SELECT",
"key": "interesse",
"options": ["Falar com vendas", "Suporte", "Parceria"]
},
{
"label": "Observações",
"type": "LONG_TEXT",
"key": "obs",
"required": False
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ararahq.com/v1/flows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Captar contato',
'category' => 'LEAD_GENERATION',
'title' => 'Fale com a gente',
'fields' => [
[
'label' => 'Seu nome',
'type' => 'TEXT',
'key' => 'nome'
],
[
'label' => 'Seu melhor e-mail',
'type' => 'EMAIL',
'key' => 'email'
],
[
'label' => 'O que você procura?',
'type' => 'SELECT',
'key' => 'interesse',
'options' => [
'Falar com vendas',
'Suporte',
'Parceria'
]
],
[
'label' => 'Observações',
'type' => 'LONG_TEXT',
'key' => 'obs',
'required' => false
]
]
]),
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;
}Criar formulário
Cria o formulário e já publica: quando a chamada volta 201 com
status: PUBLISHED, ele está no ar e não pode mais ser editado. Se só a
publicação falhar, o formulário fica em DRAFT com publishError
preenchido; publique de novo em POST /v1/flows/{id}/publish.
Não aceita Idempotency-Key. O nome é único por número, então repetir
um POST que já passou responde 409 FLOW_NAME_TAKEN em vez de duplicar.
Disponível do plano Voo para cima. Permissão: TEMPLATES_WRITE.
curl --request POST \
--url https://api.ararahq.com/v1/flows \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Captar contato",
"category": "LEAD_GENERATION",
"title": "Fale com a gente",
"fields": [
{
"label": "Seu nome",
"type": "TEXT",
"key": "nome"
},
{
"label": "Seu melhor e-mail",
"type": "EMAIL",
"key": "email"
},
{
"label": "O que você procura?",
"type": "SELECT",
"key": "interesse",
"options": [
"Falar com vendas",
"Suporte",
"Parceria"
]
},
{
"label": "Observações",
"type": "LONG_TEXT",
"key": "obs",
"required": false
}
]
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Captar contato',
category: 'LEAD_GENERATION',
title: 'Fale com a gente',
fields: [
{label: 'Seu nome', type: 'TEXT', key: 'nome'},
{label: 'Seu melhor e-mail', type: 'EMAIL', key: 'email'},
{
label: 'O que você procura?',
type: 'SELECT',
key: 'interesse',
options: ['Falar com vendas', 'Suporte', 'Parceria']
},
{label: 'Observações', type: 'LONG_TEXT', key: 'obs', required: false}
]
})
};
fetch('https://api.ararahq.com/v1/flows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.ararahq.com/v1/flows"
payload = {
"name": "Captar contato",
"category": "LEAD_GENERATION",
"title": "Fale com a gente",
"fields": [
{
"label": "Seu nome",
"type": "TEXT",
"key": "nome"
},
{
"label": "Seu melhor e-mail",
"type": "EMAIL",
"key": "email"
},
{
"label": "O que você procura?",
"type": "SELECT",
"key": "interesse",
"options": ["Falar com vendas", "Suporte", "Parceria"]
},
{
"label": "Observações",
"type": "LONG_TEXT",
"key": "obs",
"required": False
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ararahq.com/v1/flows",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Captar contato',
'category' => 'LEAD_GENERATION',
'title' => 'Fale com a gente',
'fields' => [
[
'label' => 'Seu nome',
'type' => 'TEXT',
'key' => 'nome'
],
[
'label' => 'Seu melhor e-mail',
'type' => 'EMAIL',
'key' => 'email'
],
[
'label' => 'O que você procura?',
'type' => 'SELECT',
'key' => 'interesse',
'options' => [
'Falar com vendas',
'Suporte',
'Parceria'
]
],
[
'label' => 'Observações',
'type' => 'LONG_TEXT',
'key' => 'obs',
'required' => false
]
]
]),
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;
}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.
Body
Nome interno, único por número. Só você vê.
120SIGN_UP, LEAD_GENERATION, SURVEY, APPOINTMENT_BOOKING, CONTACT_US, OTHER Aparece no topo do formulário.
30De 1 a 10 perguntas, todas na mesma tela.
1 - 10 elementsShow child attributes
Show child attributes
Texto de introdução, abaixo do título.
300Texto do botão de envio.
30Response
Formulário criado
Use como flowId no envio e no botão FLOW do template.
SIGN_UP, LEAD_GENERATION, SURVEY, APPOINTMENT_BOOKING, CONTACT_US, OTHER DRAFT: criado, mas a publicação falhou (veja publishError).
PUBLISHED: no ar, pode ser enviado. DEPRECATED: desativado.
DRAFT, PUBLISHED, DEPRECATED O formulário como foi criado, já com as chaves finais.
Show child attributes
Show child attributes
Total de respostas recebidas.
Preenchido só quando o formulário foi criado mas a publicação falhou.