Skip to main content

Overview

This guide demonstrates the complete automated onboarding flow for persons (individuals/customers) using gu1’s automatic entity creation with integrated risk assessment. The system will:
  1. Fetch official data from government registries (e.g., CPF in Brazil)
  2. Execute enrichments to gather additional information
  3. Run compliance enrichments (PEP, sanctions, adverse media screening)
  4. Execute risk matrix rules to assess risk automatically
  5. Generate alerts and investigations if rules are triggered
  6. Send notifications via Socket.IO and webhooks
This is ideal for KYC (Know Your Customer) processes where you want complete automation from data collection to risk assessment.

Prerequisites

Before starting, you need:
  1. API Key - Get one from API Keys (/org-api-keys)
  2. Risk Matrix - Create and configure a risk matrix with rules for the entity_created trigger
  3. Active Integrations - Enable enrichment providers from the Marketplace
  4. Valid Tax ID - A real tax ID from a supported country (e.g., CPF for Brazil)

The Complete Flow

Here’s what happens when you create a person automatically with a risk matrix:

Quick Start Example

Basic Person Onboarding with Risk Assessment

Complete Response Example

When the process completes successfully, you’ll receive a comprehensive response:

Step-by-Step Implementation

Step 1: Set Up Your Risk Matrix

Before creating entities, configure your risk matrix with rules:
See Risk Matrix API Reference for more details.

Step 2: Create Person with Specific Integrations

Instead of running all active integrations, you can specify which ones to execute:

Step 3: Handle Real-Time Updates with Socket.IO

Listen for real-time events during the onboarding process:

Step 4: Handle Risk-Based Workflows

Based on the risk score and alerts, implement different workflows:

Understanding the Rules Engine Integration

How Risk Matrices Work

When you set riskMatrixId in your request, the system automatically:
  1. Creates the entity with basic data from official registries
  2. Executes enrichments to gather additional information
  3. Executes enrichments for compliance screening (PEP, sanctions, etc.)
  4. Triggers the risk matrix with the entity_created trigger
  5. Evaluates all rules that match:
    • triggers includes "entity_created"
    • targetEntityTypes includes "person"
    • enabled is true
  6. Calculates risk score by summing scores from matched rules
  7. Generates alerts for rules that match and have high severity
  8. Consolidates alerts into investigations (after 3 seconds)
  9. Updates entity with final risk score and status
  10. Sends notifications via Socket.IO and webhooks

Rule Condition Examples

Rules can access enrichment results in their conditions:
See Rules API Reference for complete condition syntax.

Error Handling

Common Errors and Solutions

Best Practices

1. Always Set a Risk Matrix

2. Use Specific Integrations for Better Performance

3. Handle Async Operations

The creation is synchronous, but notifications are async:

4. Monitor Data Coverage

If rules fail due to missing data, check coverage:

Person API Reference

Complete API documentation for person creation

Risk Matrix Guide

Learn how to configure risk matrices and rules

Integrations Marketplace

Browse available enrichment providers

Webhooks Setup

Configure webhooks for event notifications