Executar Enriquecimento por ID da Entidade
curl --request POST \
--url http://api.gu1.ai/integration-execution/marketplace/enrichment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entityId": "<string>",
"integrationCodes": [
"<string>"
],
"enrichmentGroupRefs": [
"<string>"
],
"parameters": {}
}
'import requests
url = "http://api.gu1.ai/integration-execution/marketplace/enrichment"
payload = {
"entityId": "<string>",
"integrationCodes": ["<string>"],
"enrichmentGroupRefs": ["<string>"],
"parameters": {}
}
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({
entityId: '<string>',
integrationCodes: ['<string>'],
enrichmentGroupRefs: ['<string>'],
parameters: {}
})
};
fetch('http://api.gu1.ai/integration-execution/marketplace/enrichment', 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/integration-execution/marketplace/enrichment",
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([
'entityId' => '<string>',
'integrationCodes' => [
'<string>'
],
'enrichmentGroupRefs' => [
'<string>'
],
'parameters' => [
]
]),
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 := "http://api.gu1.ai/integration-execution/marketplace/enrichment"
payload := strings.NewReader("{\n \"entityId\": \"<string>\",\n \"integrationCodes\": [\n \"<string>\"\n ],\n \"enrichmentGroupRefs\": [\n \"<string>\"\n ],\n \"parameters\": {}\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("http://api.gu1.ai/integration-execution/marketplace/enrichment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entityId\": \"<string>\",\n \"integrationCodes\": [\n \"<string>\"\n ],\n \"enrichmentGroupRefs\": [\n \"<string>\"\n ],\n \"parameters\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/integration-execution/marketplace/enrichment")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entityId\": \"<string>\",\n \"integrationCodes\": [\n \"<string>\"\n ],\n \"enrichmentGroupRefs\": [\n \"<string>\"\n ],\n \"parameters\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"entityId": "<string>",
"results": [
{}
],
"totalCostCents": 123,
"totalExecutionTime": 123
}Referência API
Executar Enriquecimento por ID da Entidade
Execute integrações de enriquecimento do marketplace em uma entidade usando seu ID interno — usando provedores marketplace da gu1 para KYC, KYB e dados PEP.
POST
/
integration-execution
/
marketplace
/
enrichment
Executar Enriquecimento por ID da Entidade
curl --request POST \
--url http://api.gu1.ai/integration-execution/marketplace/enrichment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"entityId": "<string>",
"integrationCodes": [
"<string>"
],
"enrichmentGroupRefs": [
"<string>"
],
"parameters": {}
}
'import requests
url = "http://api.gu1.ai/integration-execution/marketplace/enrichment"
payload = {
"entityId": "<string>",
"integrationCodes": ["<string>"],
"enrichmentGroupRefs": ["<string>"],
"parameters": {}
}
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({
entityId: '<string>',
integrationCodes: ['<string>'],
enrichmentGroupRefs: ['<string>'],
parameters: {}
})
};
fetch('http://api.gu1.ai/integration-execution/marketplace/enrichment', 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/integration-execution/marketplace/enrichment",
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([
'entityId' => '<string>',
'integrationCodes' => [
'<string>'
],
'enrichmentGroupRefs' => [
'<string>'
],
'parameters' => [
]
]),
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 := "http://api.gu1.ai/integration-execution/marketplace/enrichment"
payload := strings.NewReader("{\n \"entityId\": \"<string>\",\n \"integrationCodes\": [\n \"<string>\"\n ],\n \"enrichmentGroupRefs\": [\n \"<string>\"\n ],\n \"parameters\": {}\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("http://api.gu1.ai/integration-execution/marketplace/enrichment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"entityId\": \"<string>\",\n \"integrationCodes\": [\n \"<string>\"\n ],\n \"enrichmentGroupRefs\": [\n \"<string>\"\n ],\n \"parameters\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://api.gu1.ai/integration-execution/marketplace/enrichment")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"entityId\": \"<string>\",\n \"integrationCodes\": [\n \"<string>\"\n ],\n \"enrichmentGroupRefs\": [\n \"<string>\"\n ],\n \"parameters\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"entityId": "<string>",
"results": [
{}
],
"totalCostCents": 123,
"totalExecutionTime": 123
}Visão Geral
Executa uma ou mais integrações de enriquecimento do marketplace em uma entidade específica para coletar dados adicionais de provedores externos. Este endpoint aceita o UUID interno da entidade e suporta execução em lote de múltiplos enriquecimentos em uma única solicitação. Nota:enrichmentGroupRefs vale apenas para esta API de execução do marketplace (e para POST .../enrichment-by-external-id). Fluxos de criação de entidades (manual ou automática) continuam aceitando apenas códigos de enriquecimento explícitos, não slugs de grupo.
Endpoint
POST http://api.gu1.ai/integration-execution/marketplace/enrichment
Autenticação
Requer uma chave API válida no cabeçalho de autorização:Authorization: Bearer YOUR_API_KEY
Corpo da Solicitação
string
required
O UUID da entidade a ser enriquecida
array<string>
Lista explícita de códigos de integração de enriquecimento a executar (mesma semântica de antes). Veja Códigos de Provedores de Integração.Você pode enviar apenas
integrationCodes, apenas enrichmentGroupRefs ou ambos. Se ambos forem enviados, a API expande os grupos em códigos, concatena integrationCodes e remove duplicatas preservando a ordem da primeira ocorrência. Pelo menos um entre integrationCodes ou enrichmentGroupRefs deve ser não vazio.array<string>
Referências a grupos de enriquecimento definidos para sua organização no Marketplace (lista salva de códigos de integração). Cada valor é o slug do grupo ou o UUID do grupo.A ordem é preservada: para cada referência, os códigos do grupo são acrescentados na ordem salva; em seguida os
integrationCodes são mesclados. Expandir grupos não ignora catálogo nem regras da org: cada código resultante ainda é avaliado pelo orquestrador (por exemplo, deve estar habilitado para a organização, salvo fluxos de fallback específicos), como ao passar códigos diretamente.object
Parâmetros adicionais opcionais para passar às integrações
Resposta
boolean
Se a operação de enriquecimento em lote foi concluída com sucesso
string
O UUID da entidade enriquecida
array
Array de resultados de enriquecimento, um para cada código de integraçãoCada resultado contém:
success(boolean) - Se este enriquecimento específico foi bem-sucedidoenrichmentId(string) - UUID do registro de execução do enriquecimentointegrationCode(string) - O código de integração que foi executadointegrationName(string) - Nome legível da integraçãoresult(object) - Dados de enriquecimento (somente se bem-sucedido)fieldsEnriched(array) - Lista de campos da entidade que foram enriquecidosdataQuality(object) - Métricas de qualidadecompleteness(number) - Pontuação de completude dos dados (0-1)confidence(number) - Pontuação de confiança (0-1)
summary(string) - Resumo legívelenrichmentData(object) - Os dados de enriquecimento reais
executionTime(number) - Tempo de execução em milissegundoscostCents(number) - Custo deste enriquecimento em centavoserror(object) - Detalhes do erro (somente se falhou)code(string) - Código de erromessage(string) - Mensagem de erro
number
Custo total de todos os enriquecimentos em centavos
number
Tempo total de execução para todos os enriquecimentos em milissegundos
Exemplos
Executar um Único Enriquecimento
curl -X POST http://api.gu1.ai/integration-execution/marketplace/enrichment \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"entityId": "550e8400-e29b-41d4-a716-446655440000",
"integrationCodes": ["ar_repet_enrichment"]
}'
const response = await fetch(
'http://api.gu1.ai/integration-execution/marketplace/enrichment',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
entityId: '550e8400-e29b-41d4-a716-446655440000',
integrationCodes: ['ar_repet_enrichment']
})
}
);
const result = await response.json();
console.log(result);
import requests
response = requests.post(
'http://api.gu1.ai/integration-execution/marketplace/enrichment',
headers={
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
json={
'entityId': '550e8400-e29b-41d4-a716-446655440000',
'integrationCodes': ['ar_repet_enrichment']
}
)
result = response.json()
print(result)
Executar Múltiplos Enriquecimentos (Lote)
curl -X POST http://api.gu1.ai/integration-execution/marketplace/enrichment \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"entityId": "550e8400-e29b-41d4-a716-446655440000",
"integrationCodes": [
"ar_repet_enrichment",
"ar_bcra_enrichment",
"ar_nosis_enrichment"
]
}'
Exemplo de Resposta - Enriquecimento Bem-Sucedido
{
"success": true,
"entityId": "550e8400-e29b-41d4-a716-446655440000",
"results": [
{
"success": true,
"enrichmentId": "enr_abc123def456",
"integrationCode": "ar_repet_enrichment",
"integrationName": "Argentina REPET Person Data",
"result": {
"fieldsEnriched": [
"name",
"taxId",
"address",
"legalStatus"
],
"dataQuality": {
"completeness": 0.95,
"confidence": 0.92
},
"summary": "Successfully enriched person data from REPET",
"enrichmentData": {
"name": "María González",
"taxId": "20-12345678-9",
"address": {
"street": "Av. Corrientes 1234",
"city": "Buenos Aires",
"province": "CABA",
"country": "AR"
},
"legalStatus": "active"
}
},
"executionTime": 1250,
"costCents": 50
}
],
"totalCostCents": 50,
"totalExecutionTime": 1250
}
Exemplo de Resposta - Lote com Resultados Mistos
{
"success": true,
"entityId": "550e8400-e29b-41d4-a716-446655440000",
"results": [
{
"success": true,
"enrichmentId": "enr_abc123",
"integrationCode": "ar_repet_enrichment",
"integrationName": "Argentina REPET Person Data",
"result": {
"fieldsEnriched": ["name", "taxId"],
"dataQuality": {
"completeness": 0.85,
"confidence": 0.90
},
"summary": "Data enriched successfully",
"enrichmentData": {
"name": "María González",
"taxId": "20-12345678-9"
}
},
"executionTime": 1200,
"costCents": 50
},
{
"success": false,
"integrationCode": "ar_bcra_enrichment",
"integrationName": "Argentina BCRA Financial Data",
"executionTime": 800,
"costCents": 0,
"error": {
"code": "NO_DATA_FOUND",
"message": "No financial data found for this entity"
}
},
{
"success": true,
"enrichmentId": "enr_xyz789",
"integrationCode": "ar_nosis_enrichment",
"integrationName": "Argentina Nosis Credit Report",
"result": {
"fieldsEnriched": ["creditScore", "riskLevel"],
"dataQuality": {
"completeness": 1.0,
"confidence": 0.95
},
"summary": "Credit report retrieved",
"enrichmentData": {
"creditScore": 720,
"riskLevel": "low"
}
},
"executionTime": 1500,
"costCents": 75
}
],
"totalCostCents": 125,
"totalExecutionTime": 3500
}
Respostas de Erro
404 Entidade Não Encontrada
{
"success": false,
"results": [],
"totalCostCents": 0,
"totalExecutionTime": 0,
"error": {
"code": "ENTITY_NOT_FOUND",
"message": "Entity not found"
}
}
401 Não Autorizado
{
"success": false,
"error": {
"code": "MISSING_ORGANIZATION",
"message": "Organization ID is required"
}
}
400 Solicitação Incorreta
{
"success": false,
"results": [],
"totalCostCents": 0,
"totalExecutionTime": 0,
"error": {
"code": "VALIDATION_ERROR",
"message": "At least one integration code is required"
}
}
Casos de Uso
Enriquecimento de Dados KYC
Enriquecer uma entidade de pessoa com dados oficiais do governo:const enrichmentResult = await fetch(
'http://api.gu1.ai/integration-execution/marketplace/enrichment',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
entityId: customerId,
integrationCodes: [
'ar_repet_enrichment', // Official identity data
'ar_renaper_enrichment' // National registry
]
})
}
).then(res => res.json());
if (enrichmentResult.success) {
console.log('Customer data enriched');
console.log('Total cost:', enrichmentResult.totalCostCents / 100, 'USD');
// Check each enrichment result
enrichmentResult.results.forEach(result => {
if (result.success) {
console.log(`✓ ${result.integrationName} completed`);
} else {
console.log(`✗ ${result.integrationName} failed: ${result.error?.message}`);
}
});
}
Devida Diligência de Empresa
Coletar dados completos da empresa de múltiplas fontes:enrichment_data = requests.post(
'http://api.gu1.ai/integration-execution/marketplace/enrichment',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
json={
'entityId': company_id,
'integrationCodes': [
'ar_afip_enrichment', # Tax authority data
'ar_bcra_enrichment', # Central bank data
'ar_commercial_registry' # Commercial registry
]
}
).json()
# Process successful enrichments
successful = [r for r in enrichment_data['results'] if r['success']]
failed = [r for r in enrichment_data['results'] if not r['success']]
print(f"Completed: {len(successful)}/{len(enrichment_data['results'])}")
print(f"Total cost: ${enrichment_data['totalCostCents'] / 100:.2f}")
Notas Importantes
- Execução em Lote: Múltiplos enriquecimentos são executados em paralelo para melhor desempenho
- Rastreamento de Custos: O custo de cada enriquecimento é rastreado individualmente e somado em
totalCostCents - Sucesso Parcial: O lote pode ter sucesso mesmo que alguns enriquecimentos individuais falhem
- Auditoria Automática: Todos os enriquecimentos são automaticamente registrados no rastro de auditoria
- Acionamento de Regras: Enriquecimentos bem-sucedidos acionam o mecanismo de regras com o evento
enrichment_completed - Idempotência: Executar o mesmo enriquecimento várias vezes pode retornar resultados em cache, a menos que
forceRefreshseja usado
Endpoints Relacionados
- Executar Enriquecimento por ID Externo - Use seu próprio identificador de entidade
- Obter Entidade - Visualizar dados de entidade enriquecida
- Listar Provedores de Integração - Códigos de enriquecimento disponíveis
Was this page helpful?