Upsert
API Reference
Upsert a person entity
Create or update a person entity in gu1 with duplicate detection on external ID, national ID, email, and phone to avoid duplicate KYC records.
PUT
Upsert
Overview
The upsert endpoint intelligently creates a new person or updates an existing one based on configurable duplicate detection strategies. It automatically handles conflicts and prevents duplicate records using exact matching, fuzzy matching, or AI-powered similarity detection.Endpoint
Authentication
Requires a valid API key in the Authorization header:Request Body
object
required
The person data (same structure as Create Person endpoint)
object
Configuration options for upsert behavior
enum
How to handle conflicts when an existing person is found:
source_wins- New data overwrites existing datatarget_wins- Keep existing data, ignore new datamanual_review- Flag for manual review without updatingsmart_merge(default) - Intelligently merge both datasets
enum
Strategy for detecting duplicate persons:
exact_match- Match by externalId and taxId (case-insensitive)fuzzy_match- Similarity matching on name and taxId (80% threshold)ai_similarity- AI-powered semantic similarity detectionhybrid(recommended) - Exact match with fuzzy fallback
boolean
default:"true"
Whether to automatically create relationships between entities
Response
boolean
Indicates if the operation succeeded
string
The action performed:
created or updatedobject
The final person state after upsert
object
The person state before update (null if newly created)
number
Confidence score (0-1) for the duplicate detection match
string
Explanation of why the person was created/updated
array
Array of field-level conflicts detected during merge (if any)
Examples
Simple Upsert (Default Behavior)
Upsert with Fuzzy Matching
Response Examples
Created New Person
Updated Existing Person
Use Cases
Data Import from CRM
Progressive Data Enrichment
Best Practices
-
Choose the Right Strategy:
exact_matchfor clean, structured data with reliable IDsfuzzy_matchfor user-entered data with potential typoshybridfor most production scenarios
-
Handle Conflicts Gracefully:
- Use
smart_mergefor automatic resolution - Use
manual_reviewfor critical data - Check
conflictsarray in response for important changes
- Use
-
Monitor Confidence Scores:
- Scores below 0.7 may indicate weak matches
- Log low-confidence updates for review
Error Responses
400 Bad Request
500 Internal Server Error
Next Steps
- List Persons - Query upserted persons
- Update Person - Make targeted updates
- Get Person - Retrieve full person details