Lead - Add New Lead [code]

API: Add New Lead

POST

api/leads

Headers

Field Type Description
Authtoken String

Required: Basic Access Authentication token.

Parameters

Mandatory Fields

Field Type Description
source String

Required: Lead source.

status String

Required: Lead status.

name String

Required: Lead name.

Optional Fields

Field Type Description
assignedoptional String

Optional: Lead assigned to a specific user.

client_idoptional String

Optional: Lead from an existing customer.

tagsoptional String

Optional: Tags associated with the lead.

contactoptional String

Optional: Lead contact person.

titleoptional String

Optional: Lead position/title.

emailoptional String

Optional: Lead email address.

websiteoptional String

Optional: Lead website.

phonenumberoptional String

Optional: Lead phone number.

companyoptional String

Optional: Lead company name.

addressoptional String

Optional: Lead physical address.

cityoptional String

Optional: Lead city.

stateoptional String

Optional: Lead state/province.

countryoptional String

Optional: Lead country.

default_languageoptional String

Optional: Lead default language.

descriptionoptional String

Optional: Lead description.

custom_contact_dateoptional String

Optional: Custom contact date for the lead.

contacted_todayoptional String

Optional: Mark if the lead was contacted today.

is_publicoptional String

Optional: Google sheet ID for public access.

Example Request Payload

{
  "status": "2",
  "source": "6",
  "assigned": "1",
  "client_id": "5",
  "tags": "",
  "name": "Lead Name",
  "contact": "Contact A",
  "title": "Position A",
  "email": "AAA@gmail.com",
  "website": "",
  "phonenumber": "123456789",
  "company": "Gap Trade",
  "address": "710-712 Cách Mạng Tháng Tám, P. 5, Q. Tân Bình",
  "city": "London",
  "state": "",
  "default_language": "english",
  "description": "Description",
  "custom_contact_date": "",
  "is_public": "on",
  "contacted_today": "on"
}

Success Response (200 OK)

Field Type Description
status Boolean

Indicates the success of the request.

message String

Message indicating successful addition of the lead.

HTTP/1.1 200 OK
{
  "status": true,
  "message": "Lead add successful."
}

Error Response (4xx)

Field Type Description
status Boolean

Indicates the failure of the request.

message String

Error message indicating the failure to add the lead.

HTTP/1.1 404 Not Found
{
  "status": false,
  "message": "Lead add fail."
}

Did you find this article useful?