Listar plantillas
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 plantillas
Lista plantillas de automatización de solo lectura en Gu1, con grafos prearmados y parámetros opcionales de preconfiguración al clonarlas al builder.
GET
/
automations
/
templates
Listar plantillas
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 plantilla incluye:
| Campo | Descripción |
|---|---|
code | Código estable del catálogo |
sortOrder | Orden en la galería |
automations | Uno o más payloads (mismo shape que POST /automations) |
visibility | Opcional { showInTabs: ["realtime" | "scheduled"] } |
parameterDefinitions | Knobs opcionales de preconfiguración (path + mirrorPaths) antes de crear |
Crear desde plantilla
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"
}
}
paramValueses opcional. Si la plantilla defineparameterDefinitionsconrequired: true, faltantes → 400.- Los valores se aplican a campos planos y al grafo vía
mirrorPaths. - Ejemplo
alert_created_email_notify: automation realtimealert_created→send_push_notification(email). - Ejemplo
entity_monitoring_scheduled: automation programada: cron →fetch_entities(filtros) →run_risk_matrix(matriz elegida).
Las automatizaciones creadas desde una plantilla se crean siempre deshabilitadas (
enabled: false), independientemente de la definición de la plantilla. Revisá la configuración y activalas con POST /automations/:id/toggle (o desde el panel) cuando estén listas.Was this page helpful?