CRM

Create a lead contact

Creates a new customer_contacts row owned by a lead. Same validation rules as the customer endpoint; the parent row must have category = 'lead' (404 otherwise).

URL forms (both accepted):

  • POST /admin/crm/leads-contacts — customer_id (the lead id) in the body (shown here).
  • POST /admin/crm/leads-contacts/{customer_id} — lead id in the URL path. Canonical form used by the FE / generated SDK / LeadsContactsCest::addEmail(). When using this form, the body customer_id is ignored. OpenAPI does not allow declaring this as a separate path entry because /leads-contacts/{customer_id} is structurally equivalent to the existing /leads-contacts/{id}.
post/admin/crm/leads-contacts

Request

  • Base URL: https://demo.splynx.com/api/2.0
  • URL: https://demo.splynx.com/api/2.0/admin/crm/leads-contacts
  • Auth: HTTP basic

Request body

customer_idnumber required

Owning lead ID. Maps to customer_contacts.customer_id.

contact_typestring required

Contact type: email or phone.

contact_valuestring required

Email address or phone number.

labelstring

Contact label: primary, billing, additional, home, work, mobile, internal. Default: primary.

is_primaryboolean

When true, any existing primary for the same (customer_id, contact_type, label) tuple is demoted atomically.

is_whatsappboolean

WhatsApp flag. Phone rows only.

country_codestring

ISO 3166-1 alpha-2 country code. Phone rows only.

contact_person_idnumber nullable

Optional link to a contact person row.

metadataobject nullable

Free-form JSON metadata.

Example request

{
  "customer_id": 1,
  "contact_type": "phone",
  "contact_value": "+380501234567",
  "label": "mobile",
  "is_primary": true,
  "is_whatsapp": true,
  "country_code": "UA",
  "contact_person_id": 1,
  "metadata": {}
}

Response

idnumber

Lead Contact ID

Example response

{
  "id": 1
}

Changes

No recorded changes to this operation across all 1 revision of this API.