curl --request POST \
--url https://api.bevits.com/v1/flows/{flow_id}/activate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"revision": "rev_3f9a1c2b7d4e"
}
'import requests
url = "https://api.bevits.com/v1/flows/{flow_id}/activate"
payload = { "revision": "rev_3f9a1c2b7d4e" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({revision: 'rev_3f9a1c2b7d4e'})
};
fetch('https://api.bevits.com/v1/flows/{flow_id}/activate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bevits.com/v1/flows/{flow_id}/activate",
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([
'revision' => 'rev_3f9a1c2b7d4e'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bevits.com/v1/flows/{flow_id}/activate"
payload := strings.NewReader("{\n \"revision\": \"rev_3f9a1c2b7d4e\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bevits.com/v1/flows/{flow_id}/activate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"revision\": \"rev_3f9a1c2b7d4e\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bevits.com/v1/flows/{flow_id}/activate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"revision\": \"rev_3f9a1c2b7d4e\"\n}"
response = http.request(request)
puts response.read_body{
"object": "flow",
"id": "<string>",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"html_url": "<string>",
"name": "<string>",
"description": "<string>",
"trigger_event_type": "<string>",
"origin": "<string>",
"run_count": 1,
"revision": "<string>"
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"message": "Invalid API key.",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "permission_denied",
"message": "This API key does not have the required \"write\" scope.",
"param": "scope",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "conflict",
"message": "The flow changed after revision rev_3f9a1c2b7d4e; its current revision is rev_9b2e7c1a5f30.",
"param": "revision",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
},
"retry_after": 2
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Ativar flow
Ativa um flow revisado, que passa a enviar mensagens reais. Exige a revision revisada pela pessoa; se o flow mudou depois dela, a chamada falha com 409 e informa a revisão atual. Faz as mesmas verificações do botão Ativar no editor. Exige uma API key com o escopo write.
curl --request POST \
--url https://api.bevits.com/v1/flows/{flow_id}/activate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"revision": "rev_3f9a1c2b7d4e"
}
'import requests
url = "https://api.bevits.com/v1/flows/{flow_id}/activate"
payload = { "revision": "rev_3f9a1c2b7d4e" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({revision: 'rev_3f9a1c2b7d4e'})
};
fetch('https://api.bevits.com/v1/flows/{flow_id}/activate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.bevits.com/v1/flows/{flow_id}/activate",
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([
'revision' => 'rev_3f9a1c2b7d4e'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.bevits.com/v1/flows/{flow_id}/activate"
payload := strings.NewReader("{\n \"revision\": \"rev_3f9a1c2b7d4e\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.bevits.com/v1/flows/{flow_id}/activate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"revision\": \"rev_3f9a1c2b7d4e\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bevits.com/v1/flows/{flow_id}/activate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"revision\": \"rev_3f9a1c2b7d4e\"\n}"
response = http.request(request)
puts response.read_body{
"object": "flow",
"id": "<string>",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"html_url": "<string>",
"name": "<string>",
"description": "<string>",
"trigger_event_type": "<string>",
"origin": "<string>",
"run_count": 1,
"revision": "<string>"
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"message": "Invalid API key.",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "permission_denied",
"message": "This API key does not have the required \"write\" scope.",
"param": "scope",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "conflict",
"message": "The flow changed after revision rev_3f9a1c2b7d4e; its current revision is rev_9b2e7c1a5f30.",
"param": "revision",
"request_id": "req_07f6cdc3c20249d6afcd90b4"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
},
"retry_after": 2
}{
"error": {
"type": "authentication_error",
"message": "<string>",
"request_id": "<string>",
"param": "<string>"
}
}Autorizações
API key criada nas configurações da organização.
Cabeçalhos
Chave única da operação. Repetir a mesma chave com o mesmo corpo devolve a resposta original em vez de executar de novo.
Parâmetros de caminho
ID público do flow.
^flw_[A-Za-z0-9_-]+$Corpo
Revisão revisada pela pessoa, retornada na criação do rascunho ou na consulta do flow.
^rev_[0-9a-f]+$Resposta
Flow encontrado.
"flow"^flw_[A-Za-z0-9_-]+$Campo legado descontinuado, mantido por compatibilidade. Quando presente, retorna sempre 0; não representa o total real de execuções.
x >= 0Identifica o conteúdo atual do flow (blocos e conexões). Informe-a ao ativar o flow para garantir que só o conteúdo revisado entre no ar.