v4

latestOpenAPI 3.1.02026-08-03427198448.4 KB
Client Enrichment

Enrich Client Enhanced

Enhanced client enrichment endpoint with unified flow.

This endpoint:

  1. Fetches org context (org_prompt, org_defaults) for the agent
  2. Runs the Client Enrichment Agent which:
    • Enriches ALL contacts using Google context + LinkedIn
    • Determines if client is individual or business
    • Enriches client data accordingly
  3. Handles save behavior based on source:
    • 'clientform': Returns data only (no auto-save)
    • 'frontend'/'agent': Auto-saves to database

Modes:

  • 'full': Overwrites all client fields with enriched data
  • 'fill_empty': Only fills fields that are currently empty
post/api/enrich-client-enhanced

Query parameters

user_idstring
org_idstring

Request body

client_idstring required

Client ID to enrich (or 'new' for new clients)

company_namestring nullable

Client name (optional)

emailstring nullable

Primary contact email (deprecated - use contacts array)

client_addressstring nullable

Client's current address

client_notesstring nullable

Client's internal notes

mode'full' | 'fill_empty'

'full' overwrites all fields, 'fill_empty' only fills empty fields

source'frontend' | 'agent' | 'clientform'

'clientform' = preview only (no auto-save), others = auto-save

Response

Successful Response

client_updatedboolean required
client_dataobject
contacts_createdobject[]
is_individualboolean

True if this is an individual, not a business