Informe PDF de entidad por correo
curl --request POST \
--url http://api.gu1.ai/entities/{id}/report-export/email \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'X-Organization-ID: <x-organization-id>' \
--data '
{
"recipientEmails": [
"<string>"
],
"emailLocale": "<string>",
"fromSenderId": {},
"fromEmail": "<string>",
"sections": {}
}
'import requests
url = "http://api.gu1.ai/entities/{id}/report-export/email"
payload = {
"recipientEmails": ["<string>"],
"emailLocale": "<string>",
"fromSenderId": {},
"fromEmail": "<string>",
"sections": {}
}
headers = {
"Authorization": "<authorization>",
"X-Organization-ID": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'X-Organization-ID': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
recipientEmails: ['<string>'],
emailLocale: '<string>',
fromSenderId: {},
fromEmail: '<string>',
sections: {}
})
};
fetch('http://api.gu1.ai/entities/{id}/report-export/email', 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/entities/{id}/report-export/email",
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([
'recipientEmails' => [
'<string>'
],
'emailLocale' => '<string>',
'fromSenderId' => [
],
'fromEmail' => '<string>',
'sections' => [
]
]),
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/entities/{id}/report-export/email"
payload := strings.NewReader("{\n \"recipientEmails\": [\n \"<string>\"\n ],\n \"emailLocale\": \"<string>\",\n \"fromSenderId\": {},\n \"fromEmail\": \"<string>\",\n \"sections\": {}\n}")
req, _ := http.NewRequest("POST", 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.post("http://api.gu1.ai/entities/{id}/report-export/email")
.header("Authorization", "<authorization>")
.header("X-Organization-ID", "<x-organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"recipientEmails\": [\n \"<string>\"\n ],\n \"emailLocale\": \"<string>\",\n \"fromSenderId\": {},\n \"fromEmail\": \"<string>\",\n \"sections\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/entities/{id}/report-export/email")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["X-Organization-ID"] = '<x-organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"recipientEmails\": [\n \"<string>\"\n ],\n \"emailLocale\": \"<string>\",\n \"fromSenderId\": {},\n \"fromEmail\": \"<string>\",\n \"sections\": {}\n}"
response = http.request(request)
puts response.read_bodyReferencia API
Informe PDF de entidad por correo
Encola en el servidor el PDF completo de una entidad (mismo diseño que la exportación del panel) y envíalo por email a uno o varios destinatarios.
POST
/
entities
/
{id}
/
report-export
/
email
Informe PDF de entidad por correo
curl --request POST \
--url http://api.gu1.ai/entities/{id}/report-export/email \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'X-Organization-ID: <x-organization-id>' \
--data '
{
"recipientEmails": [
"<string>"
],
"emailLocale": "<string>",
"fromSenderId": {},
"fromEmail": "<string>",
"sections": {}
}
'import requests
url = "http://api.gu1.ai/entities/{id}/report-export/email"
payload = {
"recipientEmails": ["<string>"],
"emailLocale": "<string>",
"fromSenderId": {},
"fromEmail": "<string>",
"sections": {}
}
headers = {
"Authorization": "<authorization>",
"X-Organization-ID": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'X-Organization-ID': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
recipientEmails: ['<string>'],
emailLocale: '<string>',
fromSenderId: {},
fromEmail: '<string>',
sections: {}
})
};
fetch('http://api.gu1.ai/entities/{id}/report-export/email', 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/entities/{id}/report-export/email",
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([
'recipientEmails' => [
'<string>'
],
'emailLocale' => '<string>',
'fromSenderId' => [
],
'fromEmail' => '<string>',
'sections' => [
]
]),
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/entities/{id}/report-export/email"
payload := strings.NewReader("{\n \"recipientEmails\": [\n \"<string>\"\n ],\n \"emailLocale\": \"<string>\",\n \"fromSenderId\": {},\n \"fromEmail\": \"<string>\",\n \"sections\": {}\n}")
req, _ := http.NewRequest("POST", 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.post("http://api.gu1.ai/entities/{id}/report-export/email")
.header("Authorization", "<authorization>")
.header("X-Organization-ID", "<x-organization-id>")
.header("Content-Type", "application/json")
.body("{\n \"recipientEmails\": [\n \"<string>\"\n ],\n \"emailLocale\": \"<string>\",\n \"fromSenderId\": {},\n \"fromEmail\": \"<string>\",\n \"sections\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/entities/{id}/report-export/email")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["X-Organization-ID"] = '<x-organization-id>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"recipientEmails\": [\n \"<string>\"\n ],\n \"emailLocale\": \"<string>\",\n \"fromSenderId\": {},\n \"fromEmail\": \"<string>\",\n \"sections\": {}\n}"
response = http.request(request)
puts response.read_bodyResumen
Encola de forma asíncrona la generación del PDF de entidad en el servidor y su envío por correo. El PDF usa el mismo flujo jsPDF que la descarga “exportar informe” en la app. Tu integración llama al endpoint con API key; los destinatarios reciben el adjunto (asunto y cuerpo segúnemailLocale).
La respuesta HTTP es 202 Accepted en cuanto el trabajo queda encolado. La generación y el envío ocurren en segundo plano; si no llega el correo, revisá logs del servidor o contactá a soporte.
Endpoint
POST http://api.gu1.ai/entities/{id}/report-export/email
Autenticación y tenant
string
required
Bearer TU_API_KEY — ver Autenticación.Permisos
Requiere el permiso granularentities:export en la API key (igual que POST /entities/{id}/export y GET /entities/{id}/export-data).
Marketplace y facturación
- La organización debe tener activa la integración
global_sender_email(Aplicaciones / Marketplace) y el servidor debe tener configurado MS Provider. - Cada dirección en
recipientEmails(tras deduplicar en el servidor) consume una ejecución del pack de Email o, si no hay pack, tokens segúnbase_price_centsde la integración. - El pre-flight valida saldo/ejecuciones para todos los destinatarios antes de encolar el trabajo.
Dominio y remitente (fromEmail)
Para usar un remitente de tu organización:
- Registrá el dominio en Ajustes → Email → Dominios y completá la verificación DNS.
- En el body, enviá
fromEmailcon cualquier dirección de ese dominio (ej.noreply@tu-dominio.com). No hace falta dar de alta esa dirección en “Remitentes” si el dominio ya está verificado. - Alternativa:
fromSenderId(UUID de una fila enorganization_email_senders) si preferís referenciar un remitente ya guardado. - Si omitís ambos, se usa el remitente por defecto de la plataforma (
noreply@gueno.com).
fromSenderId y fromEmail en el mismo request.
Riesgo vigente y screening AML en el PDF
El encabezado del PDF muestra el riesgo vigente de la entidad:- Si hay un override manual activo, el score manual aparece con el badge
RIESGO MANUALmás usuario, fecha, justificación y score anterior; el score de la matriz queda más abajo marcado como histórico no vigente. - Si no hay override, se muestra el score de la matriz con su etiqueta.
sections.checks) usa el screening normalizado, no los logs de ejecución:
- Cada fila trae resultado, coincidencias relevantes, listas y el nivel de riesgo informado por el proveedor (
reportedRiskLevel, incluidounknowncuando así lo envían). Si el proveedor no informó nivel, se usa un valor derivado de las coincidencias. - Una verificación que corrió pero no dejó screening normalizado se informa como no determinada, no como “sin coincidencias”.
GET /entities/{id}/export-data bajo riskSummary, amlScreening y checks[].
Parámetros de ruta
string
required
UUID de la entidad (
id devuelto por crear/listar/obtener).Cuerpo JSON
string[]
required
Una o más direcciones de correo (máx. 26 tras deduplicar). Solo se envía a estas direcciones; no se agrega automáticamente el email del usuario de la API key.
string
Idioma del correo:
en, es o pt. Por defecto en si falta o no es válido.string (uuid)
UUID de un remitente en Ajustes → Email → Remitentes (
organization_email_senders). Mutuamente excluyente con fromEmail.string
Dirección completa de envío (ej.
reportes@tu-dominio.com). El dominio debe estar verificado en la org. Si existe una fila en Remitentes con esa dirección, se usa su nombre; si no, basta el dominio verificado. Mutuamente excluyente con fromSenderId.object
required
Booleano por sección del informe (misma semántica que el modal de exportación en el panel). Claves opcionales; los valores por defecto coinciden con el validador de la API (
generalInfo por defecto true, el resto false si se omiten).Claves: generalInfo, kyc, documents, checks, enrichments, alerts, aiAnalysis, relationships, timeline, riskAnalysis.Ejemplo de cuerpo
{
"recipientEmails": ["cumplimiento@ejemplo.com"],
"emailLocale": "es",
"fromEmail": "noreply@tu-dominio.com",
"sections": {
"generalInfo": true,
"riskAnalysis": true,
"enrichments": true,
"alerts": true
}
}
Ejemplo con curl
curl -X POST "http://api.gu1.ai/entities/550e8400-e29b-41d4-a716-446655440000/report-export/email" \
-H "Authorization: Bearer TU_API_KEY" \
-H "X-Organization-ID: UUID_DE_TU_ORG" \
-H "Content-Type: application/json" \
-d '{
"recipientEmails": ["cumplimiento@ejemplo.com"],
"emailLocale": "es",
"fromEmail": "noreply@tu-dominio.com",
"sections": {
"generalInfo": true,
"riskAnalysis": true,
"enrichments": true
}
}'
Respuestas
202 Accepted — encolado
{
"success": true,
"status": "queued",
"message": "…"
}
message se localiza según emailLocale.
400 — validación / pre-flight
| Código / caso | Descripción |
|---|---|
NO_RECIPIENTS | recipientEmails vacío tras deduplicar. |
TOO_MANY_RECIPIENTS | Más de 26 destinatarios. |
EMAIL_INTEGRATION_INACTIVE | global_sender_email inactiva o MS Provider no configurado. |
DOMAIN_NOT_VERIFIED | Dominio de fromEmail no registrado o sin verificar DNS. |
SENDER_NOT_CONFIGURED | fromSenderId desconocido para la org. |
INVALID_SENDER | fromSenderId y fromEmail juntos, o formato inválido. |
INSUFFICIENT_BALANCE | Tokens o ejecuciones de pack insuficientes para todos los destinatarios. |
404 — entidad inexistente u oculta
Mismo criterio que otros endpoints de entidad cuando el ID no pertenece a la org o la visibilidad lo impide.500 — error de servidor
Poco frecuente; payload de error genérico.Endpoints relacionados
POST /entities/{id}/export— descarga síncrona del PDF (cuerpo de la respuesta = archivo PDF).GET /entities/{id}/export-data— JSON usado por la exportación en el panel; el PDF por correo arma los mismos datos en servidor.- Exportación masiva por correo —
POST /entities/export/jobs(CSV/XLSX/JSON con filtros de listado). - Obtener entidad —
GET /entities/{id}.
Was this page helpful?