Leads

Create leads in Pixelwand CRM from external sources.

Create a lead from any external source — a website form, a landing page, or another system — using the Leads API. New leads are added to the team that owns the API key used in the request.

Create a lead

POST /api/method/crm.api.leads.create_lead

Headers

See Authentication for details.

HeaderRequiredDescription
X-API-KeyYesThe team API key.
X-API-SecretYesThe matching API secret.

Body parameters

Parameters can be sent as form-data or JSON.

FieldRequiredDescription
nameYesFull name of the lead. The first word becomes the first name; the rest becomes the last name.
emailNoEmail address. Validated; an invalid address is rejected.
phoneNoPhone number. Skipped if the value is not a valid number.
mobile_noNoMobile number. Skipped if the value is not a valid number.
sourceNoLead source (default: API).
organizationNoOrganization name.
job_titleNoJob title.
websiteNoWebsite URL.
territoryNoTerritory.
industryNoIndustry.
annual_revenueNoAnnual revenue.
no_of_employeesNoNumber of employees.
utm_source, utm_medium, utm_campaign, utm_term, utm_contentNoUTM attribution fields.
<any_custom_field>NoAny field not listed above is captured into the lead's extra_fields (see below).

Example request

curl -X POST https://crm.pixelwand.io/api/method/crm.api.leads.create_lead \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -d "name=John Doe" \
  -d "email=john@example.com" \
  -d "phone=+1234567890" \
  -d "source=Website" \
  -d "utm_source=google" \
  -d "referral_code=REF123" \
  -d "campaign_id=CAMP456"

Extra fields

Any parameter not in the list above is treated as a custom field and stored in the lead's extra_fields JSON column. These fields appear in the lead detail view under Extra Fields and behave identically to fields captured from unknown CSV columns during import.

# These unknown fields get stored in extra_fields automatically
-d "referral_code=REF123"
-d "campaign_id=CAMP456"
-d "custom_note=Found us via podcast"

The resulting extra_fields on the lead will be:

{
  "referral_code": "REF123",
  "campaign_id": "CAMP456",
  "custom_note": "Found us via podcast"
}

Responses

Success

{
  "success": true,
  "lead_id": "CRM-LEAD-0001",
  "message": "Lead created successfully"
}

Error

{
  "success": false,
  "error": "Validation failed",
  "message": "Name is required"
}

Notes

  • name is the only required field; a request without it is rejected.
  • Invalid phone or mobile_no values are silently skipped rather than failing the whole request, so the lead is still created.

On this page