Create or upsert a lead
Matches the person on external_id, then phone, then email; on_conflict decides what happens to a match. Custom fields with no field in the workspace are one 400 naming them all, or new text fields with create_missing_fields.
Headers
Your unique id for this request (≤ 255 characters). Repeating it within 24 h replays the first answer instead of writing twice.
Request
A lead to create or change. Send only what you have; custom fields go inside fields.
Indian numbers in any common shape: 9876543210, +91 98765 43210.
Your id for the person (customer no., loan no., employee id) — the best key to upsert on.
From GET /crm/stages.
From GET /crm/pipelines; without stage_id the lead goes to that pipeline’s first stage.
Custom fields by key or by label, in any case (GET /crm/fields lists them): {“Zone”: “Madhapur”}.
On create only: a short lower-case word (default “api”).
On create only, e.g. {“form”: “Contact us”}.
When the person is already a lead: error (default, 409), update, or ignore.
What makes two leads the same person (default all three, in that order).
Response
Matched an existing lead (updated or unchanged).
