Skip to navigation

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

Idempotency-KeystringOptional

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.

namestring or nullOptional
phonestring or nullOptional

Indian numbers in any common shape: 9876543210, +91 98765 43210.

emailstring or nullOptional
external_idstring or nullOptional

Your id for the person (customer no., loan no., employee id) — the best key to upsert on.

companystring or nullOptional
citystring or nullOptional
stage_idstring or nullOptional

From GET /crm/stages.

pipeline_idstring or nullOptional

From GET /crm/pipelines; without stage_id the lead goes to that pipeline’s first stage.

owner_user_idstring or nullOptional
tagslist of strings or nullOptional
scoreinteger or nullOptional0-100
score_labelenum or nullOptional
Allowed values:
expected_close_atstring or nullOptional
probabilityinteger or nullOptional0-100
lost_reasonstring or nullOptional
next_action_atstring or nullOptional
consentobject or nullOptional
fieldsobject or nullOptional

Custom fields by key or by label, in any case (GET /crm/fields lists them): {“Zone”: “Madhapur”}.

sourcestring or nullOptional

On create only: a short lower-case word (default “api”).

source_detailobject or nullOptional

On create only, e.g. {“form”: “Contact us”}.

on_conflictenum or nullOptional

When the person is already a lead: error (default, 409), update, or ignore.

Allowed values:
match_onlist of enums or nullOptional

What makes two leads the same person (default all three, in that order).

Allowed values:
create_missing_fieldsboolean or nullOptional
Custom field names that don't exist become text fields instead of a 400.

Response

Matched an existing lead (updated or unchanged).

resultenum
Allowed values:
leadobject
created_fieldslist of objects or nullOptional

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
409
Conflict Error
429
Too Many Requests Error