CreateNewLead

Function creates a new lead. The assignee is notified by e-mail

POST https://rest.crmango.com/api/CreateNewLead

Authorization

1 Sent in the request headers
Bearer varchar

Auth token

Body data

24 Sent in the request body
lead_name varchar

Lead name (required)

lead_creator integer

Lead creator. For a token bound to a user it is always that user
Reference: GetAllUsers

when_contact_date date

Date when to contact the lead (YYYY-MM-DD)

contacted_date date

Date when the lead was contacted (YYYY-MM-DD)

lead_assignee integer

Assigned user, 0 = unassigned
Reference: GetAllUsers

company_id varchar

Company id (IČO)

company_mango_id integer

Company id in Mango
Reference: GetAllCompanies

company_name varchar

Company name

company_country_id integer

Country id
Reference: GetAllStates

company_country varchar

Country ISO2 code

company_address varchar

Company address

company_postal varchar

Company postal

person_name varchar

Person name

person_surname varchar

Person surname

person_phone varchar

Person phone number

person_email varchar

Person e-mail

person_mango_id integer

Person id in Mango
Reference: GetAllPersons

lead_status_id integer

Lead status id
Reference: GetAllLists

lead_source_id integer

Lead source id
Reference: GetAllLists

lead_campaign_id integer

Lead campaign id
Reference: GetAllLists

priority integer

Priority
Options: 1, 2 or 3

lead_note varchar

Note

product_id integer

Id of active product/service

affiliate_code varchar

Affiliate code

Response

3 HTTP 201

Function creates a new lead

code integer

Return code

message varchar

Info message

created_id integer

Id of the created resource

Example request

curl --request POST \
  --url 'https://rest.crmango.com/api/CreateNewLead' \
  --header 'Authorization: Bearer auth_token' \
  --header 'Content-Type: application/json' \
  --data '{
    "data": {
      "lead_name": "CRMango s.r.o.",
      "when_contact_date": "2022-12-23",
      "contacted_date": "2023-03-12",
      "lead_creator": 0,
      "lead_assignee": 0,
      "company_id": "",
      "company_mango_id": 0,
      "company_name": "Crmango s.r.o.",
      "company_country_id": 56,
      "company_country": "CZ",
      "company_address": "Hlavna 70",
      "company_postal": "32323",
      "person_name": "",
      "person_surname": "",
      "person_phone": "",
      "person_email": "",
      "person_mango_id": 0,
      "lead_status_id": 1,
      "lead_source_id": 3,
      "lead_campaign_id": 1,
      "priority": 3,
      "lead_note": "note",
      "affiliate_code": "L59jahNtWjH6QuG4|!|!|!150Pv22|!|!|!Vs9Udd1F1jcSoIxrzQ=",
      "product_id": 11
    }
  }'
{
    "code": 201,
    "message": "New lead has been created",
    "created_id": 158
}