Contents
On this page

Create Lead - Plugixa CRM

POST /plugixa-crm/v1/leads

Create a lead: a person or company you have not qualified yet.

Any user with access to Plugixa CRM. With Plugixa CRM Pro roles, the user’s role must also allow creating leads.

Note. To capture leads from a public form without signing in, post to Submit Lead Form instead.

Request

POST https://your-site.example/wp-json/plugixa-crm/v1/leads

Request body

Content type: application/json

Field Type Required Description
first_name string See below First name.
last_name string See below Last name. full_name is made from both.
account_name string See below The company, as free text.
salutation string No Free text.
title string No Job title.
email string No An e-mail address. A value that is not one is stored empty.
phone string No Free text.
website string No A URL. A value without a scheme gets http:// in front.
industry string No Free text.
source string No Where the lead came from, free text, for example web_site.
status string No new, assigned, in_process, recycled or dead. Anything else, or nothing, is stored as new. converted is refused: use Convert Lead.
score integer No 0 to 100. Values outside are clamped. Defaults to 0.
opportunity_amount number No The expected deal value. Negative values become 0.
opportunity_currency string No Three letters, upper-cased for you. Defaults to USD.
do_not_call boolean No Defaults to false.
address_street string No Postal address.
address_city string No Postal address.
address_state string No Postal address.
address_postal_code string No Postal address.
address_country string No Postal address.
description string No HTML. Tags not allowed in post content are stripped.
assigned_user_id integer No The WordPress user who owns the lead. 0 or nothing means none.

A lead needs at least one of first_name, last_name and account_name. Fields not in this table, the converted_* fields included, are ignored.

{
  "first_name": "Ada",
  "last_name": "Lovelace",
  "account_name": "Analytical Engines Ltd",
  "title": "CTO",
  "email": "ada@analytical.example",
  "website": "https://analytical.example",
  "industry": "Software",
  "source": "web_site",
  "score": 40,
  "opportunity_amount": 12000,
  "opportunity_currency": "EUR",
  "address_city": "London",
  "address_country": "United Kingdom",
  "assigned_user_id": 3
}

Responses

201 Created. data is the new lead.

{
  "success": true,
  "data": {
    "id": 22,
    "salutation": "",
    "first_name": "Ada",
    "last_name": "Lovelace",
    "full_name": "Ada Lovelace",
    "account_name": "Analytical Engines Ltd",
    "title": "CTO",
    "email": "ada@analytical.example",
    "phone": "",
    "website": "https://analytical.example",
    "status": "new",
    "source": "web_site",
    "industry": "Software",
    "score": 40,
    "opportunity_amount": 12000,
    "opportunity_currency": "EUR",
    "address_city": "London",
    "address_country": "United Kingdom",
    "description": "",
    "converted_at": null,
    "converted_account_id": null,
    "converted_contact_id": null,
    "converted_opportunity_id": null,
    "assigned_user_id": 3,
    "created_by": "1",
    "modified_by": "1",
    "created_at": "2026-11-12 09:30:00",
    "modified_at": "2026-11-12 09:30:00",
    "deleted_at": null,
    "do_not_call": "0",
    "address_street": "",
    "address_state": "",
    "address_postal_code": ""
  }
}
Field Type Meaning
data.id integer The lead’s id
data.full_name string First and last name
data.account_name string The company, as free text
data.status string new, assigned, in_process, converted, recycled or dead
data.source string Where the lead came from, free text such as web_site
data.score integer 0 to 100
data.opportunity_amount number The expected deal value
data.opportunity_currency string Three-letter currency code
data.assigned_user_id integer|null The WordPress user who owns the lead
data.converted_at string|null UTC datetime of the conversion
data.converted_account_id integer|null The account the conversion used or created
data.converted_contact_id integer|null The contact it created
data.converted_opportunity_id integer|null The opportunity it created
data.do_not_call string "1" or "0"
data.created_at string UTC datetime

Errors

Status Code When
422 plugixa_crm_invalid_lead first_name, last_name and account_name are all missing or blank.
422 plugixa_crm_lead_not_converted status is converted.

Plus the errors every endpoint can return.

Examples

curl -s -X POST "https://your-site.example/wp-json/plugixa-crm/v1/leads" \
  -u "admin:$WP_APP_PASSWORD" \
  -H "Content-Type: application/json" \
  -d '{"first_name":"Ada","last_name":"Lovelace","account_name":"Analytical Engines Ltd","title":"CTO","email":"ada@analytical.example","website":"https://analytical.example","industry":"Software","source":"web_site","score":40,"opportunity_amount":12000,"opportunity_currency":"EUR","address_city":"London","address_country":"United Kingdom","assigned_user_id":3}'
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-crm/v1/leads');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST  => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_USERPWD        => 'admin:' . getenv('WP_APP_PASSWORD'),
    CURLOPT_HTTPHEADER     => ['Content-Type: application/json'],
    CURLOPT_POSTFIELDS     => json_encode([
        'first_name'           => 'Ada',
        'last_name'            => 'Lovelace',
        'account_name'         => 'Analytical Engines Ltd',
        'title'                => 'CTO',
        'email'                => 'ada@analytical.example',
        'website'              => 'https://analytical.example',
        'industry'             => 'Software',
        'source'               => 'web_site',
        'score'                => 40,
        'opportunity_amount'   => 12000,
        'opportunity_currency' => 'EUR',
        'address_city'         => 'London',
        'address_country'      => 'United Kingdom',
        'assigned_user_id'     => 3,
    ]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const auth = 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`);
const response = await fetch('https://your-site.example/wp-json/plugixa-crm/v1/leads', {
  method: 'POST',
  headers: {
    'Authorization': auth,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    first_name: 'Ada',
    last_name: 'Lovelace',
    account_name: 'Analytical Engines Ltd',
    title: 'CTO',
    email: 'ada@analytical.example',
    website: 'https://analytical.example',
    industry: 'Software',
    source: 'web_site',
    score: 40,
    opportunity_amount: 12000,
    opportunity_currency: 'EUR',
    address_city: 'London',
    address_country: 'United Kingdom',
    assigned_user_id: 3,
  }),
});
const { data } = await response.json();

Quick Links

Share