Listar modelos
curl --request GET \
--url http://api.gu1.ai/automations/templates \
--header 'Authorization: Bearer <token>'import requests
url = "http://api.gu1.ai/automations/templates"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://api.gu1.ai/automations/templates', 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 => "http://api.gu1.ai/automations/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://api.gu1.ai/automations/templates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://api.gu1.ai/automations/templates")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/automations/templates")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyAPI Reference
Listar modelos
Lista modelos de automação somente leitura no Gu1, com grafos pré-montados e parâmetros opcionais de pré-configuração ao cloná-los no builder.
GET
/
automations
/
templates
Listar modelos
curl --request GET \
--url http://api.gu1.ai/automations/templates \
--header 'Authorization: Bearer <token>'import requests
url = "http://api.gu1.ai/automations/templates"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://api.gu1.ai/automations/templates', 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 => "http://api.gu1.ai/automations/templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://api.gu1.ai/automations/templates"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://api.gu1.ai/automations/templates")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/automations/templates")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_bodyEndpoint
GET https://api.gu1.ai/automations/templates
Response
200 —{ "templates": [ ... ] }
Cada modelo inclui:
| Campo | Descrição |
|---|---|
code | Código estável do catálogo |
sortOrder | Ordem na galeria |
automations | Um ou mais payloads (mesmo shape que POST /automations) |
visibility | Opcional { showInTabs: ["realtime" | "scheduled"] } |
parameterDefinitions | Knobs opcionais de pré-configuração (path + mirrorPaths) antes de criar |
Criar a partir do modelo
POST https://api.gu1.ai/automations/from-template
{
"code": "alert_created_email_notify",
"paramValues": {
"rule_external_ids": [],
"severities": ["HIGH", "CRITICAL"],
"recipient_emails": "ops@example.com",
"message_template": "alert_created_email"
}
}
paramValuesé opcional. Se o modelo defineparameterDefinitionscomrequired: true, faltantes → 400.- Os valores são aplicados aos campos planos e ao grafo via
mirrorPaths. - Exemplo
alert_created_email_notify: automação realtimealert_created→send_push_notification(email). - Exemplo
entity_monitoring_scheduled: automação agendada: cron →fetch_entities(filtros) →run_risk_matrix(matriz escolhida).
As automações criadas a partir de um modelo são sempre criadas desabilitadas (
enabled: false), independentemente da definição do modelo. Revise a configuração e ative-as com POST /automations/:id/toggle (ou pelo painel) quando estiverem prontas.Was this page helpful?