Plantillas de reportes
curl --request GET \
--url http://api.gu1.ai/report-templates \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'X-Organization-ID: <x-organization-id>' \
--data '
{
"format": "<string>",
"emailLocale": "<string>",
"params": {},
"delivery": "<string>",
"recipientEmails": [
"<string>"
]
}
'import requests
url = "http://api.gu1.ai/report-templates"
payload = {
"format": "<string>",
"emailLocale": "<string>",
"params": {},
"delivery": "<string>",
"recipientEmails": ["<string>"]
}
headers = {
"Authorization": "<authorization>",
"X-Organization-ID": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
Authorization: '<authorization>',
'X-Organization-ID': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
format: '<string>',
emailLocale: '<string>',
params: {},
delivery: '<string>',
recipientEmails: ['<string>']
})
};
fetch('http://api.gu1.ai/report-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/report-templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'format' => '<string>',
'emailLocale' => '<string>',
'params' => [
],
'delivery' => '<string>',
'recipientEmails' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"X-Organization-ID: <x-organization-id>"
],
]);
$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 := "http://api.gu1.ai/report-templates"
payload := strings.NewReader("{\n \"format\": \"<string>\",\n \"emailLocale\": \"<string>\",\n \"params\": {},\n \"delivery\": \"<string>\",\n \"recipientEmails\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("GET", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("X-Organization-ID", "<x-organization-id>")
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.get("http://api.gu1.ai/report-templates")
.header("Authorization", "<authorization>")
.header("X-Organization-ID", "<x-organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"format\": \"<string>\",\n \"emailLocale\": \"<string>\",\n \"params\": {},\n \"delivery\": \"<string>\",\n \"recipientEmails\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/report-templates")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
request["X-Organization-ID"] = '<x-organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"format\": \"<string>\",\n \"emailLocale\": \"<string>\",\n \"params\": {},\n \"delivery\": \"<string>\",\n \"recipientEmails\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyPlantillas de reportes
Listar plantillas operativas Gu1 y encolar corridas async a object storage (email opcional).
GET
/
report-templates
Plantillas de reportes
curl --request GET \
--url http://api.gu1.ai/report-templates \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'X-Organization-ID: <x-organization-id>' \
--data '
{
"format": "<string>",
"emailLocale": "<string>",
"params": {},
"delivery": "<string>",
"recipientEmails": [
"<string>"
]
}
'import requests
url = "http://api.gu1.ai/report-templates"
payload = {
"format": "<string>",
"emailLocale": "<string>",
"params": {},
"delivery": "<string>",
"recipientEmails": ["<string>"]
}
headers = {
"Authorization": "<authorization>",
"X-Organization-ID": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
Authorization: '<authorization>',
'X-Organization-ID': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
format: '<string>',
emailLocale: '<string>',
params: {},
delivery: '<string>',
recipientEmails: ['<string>']
})
};
fetch('http://api.gu1.ai/report-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/report-templates",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'format' => '<string>',
'emailLocale' => '<string>',
'params' => [
],
'delivery' => '<string>',
'recipientEmails' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"X-Organization-ID: <x-organization-id>"
],
]);
$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 := "http://api.gu1.ai/report-templates"
payload := strings.NewReader("{\n \"format\": \"<string>\",\n \"emailLocale\": \"<string>\",\n \"params\": {},\n \"delivery\": \"<string>\",\n \"recipientEmails\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("GET", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("X-Organization-ID", "<x-organization-id>")
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.get("http://api.gu1.ai/report-templates")
.header("Authorization", "<authorization>")
.header("X-Organization-ID", "<x-organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"format\": \"<string>\",\n \"emailLocale\": \"<string>\",\n \"params\": {},\n \"delivery\": \"<string>\",\n \"recipientEmails\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/report-templates")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<authorization>'
request["X-Organization-ID"] = '<x-organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"format\": \"<string>\",\n \"emailLocale\": \"<string>\",\n \"params\": {},\n \"delivery\": \"<string>\",\n \"recipientEmails\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyResumen
Gu1 publica un catálogo code-first de plantillas operativas (alertas por reglas, exportaciones masivas y vistas de Metrics Hub). Las mismas plantillas alimentan ReporterÃa (bajo demanda) y la acción de automationsend_report / Generar reporte (reportPresetId o reportTemplateCode + params).
| Método | Path | Uso |
|---|---|---|
GET | /report-templates | Listar catálogo (category opcional) |
GET | /report-templates/{code} | Detalle + parameterDefinitions |
POST | /report-templates/{code}/preview | Descargar vista previa CSV/PDF con datos de ejemplo |
POST | /report-templates/{code}/run | Encolar exportación async (download o email) |
alerts_by_rules) encolan un job en segundo plano, guardan el archivo en object storage y responden 202 con result.jobId. Descargá después desde Jobs de exportación de reportes (ReporterÃa Descargables). Comparten el cooldown de export por organización cuando aplica.
Autenticación y tenant
string
required
Bearer YOUR_API_KEY — ver Autenticación.Permisos
| Endpoint | Permiso granular |
|---|---|
GET list / get | reports:read |
POST preview / run | reports:export |
Listar plantillas
GET http://api.gu1.ai/report-templates
string
Filtro opcional:
alerts, metrics, entities, transactions, investigations.Obtener una plantilla
GET http://api.gu1.ai/report-templates/{code}
404 con REPORT_TEMPLATE_NOT_FOUND si el código no existe.
Vista previa (datos de ejemplo)
POST http://api.gu1.ai/report-templates/{code}/preview
string
csv (default) o pdf.string
Opcional:
es, en o pt (copy del PDF).Content-Disposition: attachment (preview-{code}.csv|pdf).
Ejecutar una plantilla
POST http://api.gu1.ai/report-templates/{code}/run
object
Parámetros de la plantilla (
lookbackDays, ruleIds, emailLocale, filters, etc.).string
Debe estar en
formats de la plantilla. Default: defaultFormat.string
required
download (solo encolar job) o email (encolar job + enviar correo). La UI de ReporterÃa siempre usa download.string[]
Obligatorio si
delivery es email.Respuesta (202)
{
"success": true,
"result": {
"success": true,
"jobId": "…",
"status": "queued",
"delivery": "download"
}
}
Semántica: alerts_by_rules
Exporta alertas ya creadas del tenant cuyo alerted_at cae en la ventana lookbackDays.
ruleIds(array UUID, opcional): si se envÃa, filtratrigger_rule_id IN (...). VacÃo = todas las reglas.- Columnas: entidad, tax ID, alerta, severidad, estado, score, regla, nº de investigación, link al caso/alerta, fecha.
- Orden: nombre de entidad, luego fecha de alerta.
- No recalcula la matriz ni inventa umbrales: solo lista alertas persistidas.
Rate limit
Si hubo otra exportación reciente en la org, puede responder 429 conEXPORT_RATE_LIMIT, header Retry-After y retryAfterSeconds / cooldownSeconds en error.details.
Ejemplo
{
"params": {
"lookbackDays": 30,
"ruleIds": ["aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"]
},
"format": "xlsx",
"delivery": "email",
"recipientEmails": ["ops@example.com"]
}
Respuesta 202 (email)
{
"success": true,
"result": {
"success": true,
"code": "alerts_by_rules",
"delivery": "email",
"jobId": "…",
"status": "queued"
}
}
Respuesta 202 (download)
{
"success": true,
"result": {
"success": true,
"code": "alerts_by_rules",
"delivery": "download",
"jobId": "…",
"status": "queued"
}
}
Automations
La entrega programada usasend_report (Generar reporte) con:
reportPresetId(canónico): ejecuta el preset congelado; siempre crea un job en S3. ConsendEmail: trueyrecipientEmailstambién envÃa el archivo por correo.- Legacy:
reportTemplateCode+params, oreportTypesin preset.
/automations/builder?type=scheduled&reportPresetId=….
Ver Jobs de exportación de reportes para Descargables.
Filtros configurables
Las plantillas operativas exponen un constructorcampo → operador → valor. Enviá las condiciones en params.filters; todas se combinan con Y. Una lista vacÃa incluye todos los registros. Los presets de reportes congelan las condiciones completas.
Los campos con catálogo cambian el control según el operador: equals recibe un valor único y in recibe un array. Por ejemplo, paÃs puede usar { "operator": "equals", "value": "AR" } o { "operator": "in", "value": ["AR", "BR"] }.
{
"params": {
"filters": [
{ "id": "f1", "field": "tax_id", "operator": "in_custom_list", "value": "11111111-1111-4111-8111-111111111111" },
{ "id": "f2", "field": "age", "operator": "gte", "value": "18" },
{ "id": "f3", "field": "is_pep", "operator": "is_true", "value": "" }
]
},
"format": "xlsx",
"delivery": "download"
}
- Alertas: regla (
in), severidad, estado, tipo afectado, score, falso positivo, fecha y tipo de alerta. - Entidades: tipo, estado, Tax ID exacto o en lista personalizada, paÃs, ID externo, búsqueda, edad, score, estado KYC, regla con hit, fechas de alta/enriquecimiento, PEP, sanciones, medios adversos, MEI, procesos legales —incluidos criminales—, socios, relaciones, actividad electoral, actividades económicas e investigaciones activas.
- Transacciones: tipo, estado, medio de pago, score, monto, moneda, fecha, regla con hit, Tax ID relacionado, IDs externos de origen/destino, autotransacción, ausencia de evaluación, hit de regla shadow, búsqueda, marcada y presencia de alertas.
- Investigaciones: estado, prioridad, tipologÃa, score, tipo de objetivo, fechas de creación/actualización y búsqueda en tÃtulo/descripción.
equals, contains, in, gte, lte, between, before, after, is_true, is_false, in_custom_list y not_in_custom_list. El catálogo devuelto por GET /report-templates incluye filterFields con los operadores y opciones válidos para cada plantilla.Was this page helpful?