Skip to main content

Create or Update Lead

Create a new lead or update an existing one, identified by its primary phone number. This is an upsert by customer_phone — set create_customer_if_customer_phone_not_found: true to allow the call to create a lead when no match exists.

This endpoint is the main entry point for syncing leads from an external system (your website form, marketplace, or another CRM) into Superfone.

Authentication Required

Requires the x-api-key header. See Overview for details.

HTTP Request

POST /enterprise/api/lead

Request Body

FieldTypeRequiredDescription
customer_phonestringYesPrimary phone number used to look up (and, if missing, create) the lead. E.164 format.
create_customer_if_customer_phone_not_foundbooleanNoIf true, a new lead is created when customer_phone doesn't match any existing lead. Default: false (returns 400 Customer not found).
first_namestringNoLead's first name.
last_namestringNoLead's last name.
emailstring[]NoOne or more email addresses.
websitestringNoLead's website.
addressobjectNoAddress object. See Address object.
citystringNoCity name.
business_namestringNoLead's business or company name.
additional_infostringNoFree-form notes / additional info on the lead.
deal_valuenumberNoEstimated deal value.
sourcestringNoFree-form source string (e.g. "website-form", "marketplace-x").
source_typestringNoOne of the predefined source types. See List source types.
assignee_user_phonestring | nullNoPhone (E.164) of a Superfone team member to assign the lead to. The user must already be part of your account. Pass null to unassign.
lead_stage_namestring | nullNoName of an existing lead stage in your account. Pass null to clear.
lead_group_namestring | nullNoName of an existing lead group in your account. Pass null to clear.
add_labelsstring[]NoNames of existing labels to attach. Cannot be combined with remove_labels in the same request.
remove_labelsstring[]NoNames of existing labels to detach. Cannot be combined with add_labels in the same request.
add_productsstring[]NoNames of existing products to attach to the lead.
add_phonesstring[]NoSecondary phone numbers to attach to the lead, in addition to customer_phone. See add_phones behavior.
customer_notestringNoA note to add to the lead's timeline.

Address object

FieldTypeDescription
textstring | nullFree-form address text
additionalstring | nullApartment / unit / additional line
initialsstring | nullAddress initials (used for display)
latitudenumber | nullLatitude
longitudenumber | nullLongitude

add_phones behavior

add_phones is how you attach additional / secondary phone numbers to a lead — for example, a customer's office line in addition to their mobile number. It never replaces customer_phone.

Format

Each entry should be in E.164 format (international, with + prefix). Examples: +918000000001, +14155552671. An invalid number anywhere in the array fails the whole request with 400 Invalid phone number..

Deduplication

  • Duplicates within the add_phones array are silently collapsed.
  • A phone that already exists on the same lead (matched via customer_phone) is silently skipped — no error, no duplicate row.
  • A phone that already belongs to a different lead in your account fails the request with 400 Phone number {phone} in add_phones is already present in different customer .... To move a phone between leads, remove it from the other lead first (via the dashboard).

Existing vs. new leads

  • When customer_phone matches an existing lead, surviving entries in add_phones are appended to that lead's existing phone list.
  • When the lead is being created in this request (create_customer_if_customer_phone_not_found: true and no match), the new lead starts with customer_phone, then add_phones entries are appended.

Example

{
"customer_phone": "+918000000001",
"add_phones": ["+918000000002", "+918000000003"]
}

After this request the lead has three phones: +918000000001 (primary, from customer_phone) plus +918000000002 and +918000000003 as secondary.

Notes on behavior

  • customer_phone is treated as the lead's primary phone. If it doesn't match any existing lead and create_customer_if_customer_phone_not_found is true, a new lead is created with this phone as its only phone.
  • For add_labels / remove_labels / add_products: unknown names are silently ignored. To discover valid names, call List labels and List products.
  • For lead_stage_name and lead_group_name: the name must match an existing item exactly. Unknown names return 404. If multiple items share the name, the request returns 400 — keep your stage/group names unique.

Try it

Loading playground…

Code Examples

curl -X POST https://prod-api.superfone.co.in/superfone/enterprise/api/lead \
-H "x-api-key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"customer_phone": "+918000000001",
"create_customer_if_customer_phone_not_found": true,
"first_name": "Asha",
"last_name": "Kumar",
"email": ["asha@example.com"],
"business_name": "Acme Pvt Ltd",
"city": "Bengaluru",
"deal_value": 50000,
"source": "website-form",
"source_type": "OTHERS",
"lead_stage_name": "New Lead",
"lead_group_name": "Inbound",
"add_labels": ["Hot", "Demo Requested"],
"add_products": ["Starter Plan"],
"assignee_user_phone": "+919876543210",
"add_phones": ["+918000000002"],
"customer_note": "Asked for a callback after 6 PM."
}'

Success Response

Status Code: 200 OK

{
"data": null,
"message": "success"
}

The endpoint returns an empty data field on success. If you need the full lead record after writing, follow up with Get Lead.

Error Responses

StatusMessageWhen it occurs
400Customer phone is required to identify the record to updatecustomer_phone missing from body
400Invalid phone number.customer_phone or any value in add_phones is not a valid E.164 number
400Customer not found.customer_phone doesn't match any lead and create_customer_if_customer_phone_not_found was not true
400Customer phone exists in multiple contactcustomer_phone appears as a primary phone on more than one lead in your account
400Phone number {phone} in add_phones is already present in different customer ...A phone in add_phones already belongs to another lead
400add_labels and remove_labels cannot be used in the same requestBoth fields were provided
400Assignee user's phone is invalidassignee_user_phone is not a valid E.164 number
400Assignee user is not part of your teamThe user with that phone exists but is not an active member of your account
400Multiple lead stages found with this name. Provide uniqueMore than one lead stage matches lead_stage_name
400Multiple lead groups found with this name. Provide uniqueMore than one lead group matches lead_group_name
401UnAuthorized, Please Provide Valid API KeyMissing or invalid x-api-key
404Assignee user not foundNo user exists with the phone given in assignee_user_phone
404Lead stage name not foundlead_stage_name doesn't match any stage in your account
404Lead group name not foundlead_group_name doesn't match any group in your account

Example error

{
"message": "Lead stage name not found"
}