How To: Lead creation from external services

6 min read
Vlad Kovalskiy
April 26, 2013
Last updated: April 5, 2023
How To: Lead creation from external services
This post is outdated. Please use new Bitrix24 web forms instead - 

Suppose you have a form on a site that visitors can fill out. Using the REST API of Bitrix24, you can use the data received in this form to create a lead in the CRM.

The REST API can be used to only to import leads in the CRM. Soon, the API will be capable of importing other CRM entities (contacts, companies and deals).

Creating leads in the CRM from external services can be done using the special-purpose page:

For a lead to be added to the CRM you must:
  1. Call this page with a GET or POST method
  2. Pass at least 3 required parameters: login and password of the user who is the creator of the lead, and the title of the lead.
The script will return a JSON-object with the parameters code and error_message.

Table 1: Response codes and descriptions
Code Description
400 Parameters missing or parameters invalid
403 Authorization or access error
201 Lead added

  Table 2: Parameters

Parameter Type Description
LOGIN* String Login
PASSWORD* String Password
TITLE* String Title
COMPANY_TITLE String Company Name
NAME String First Name
LAST_NAME String Last Name
SECOND_NAME String Second Name
POST String Position
ADDRESS String Address
COMMENTS String Comment
SOURCE_DESCRIPTION String Source Description
STATUS_DESCRIPTION String Status Description
OPPORTUNITY Double Opportunity
CURRENCY_ID String Currency
PRODUCT_ID String Product
SOURCE_ID String Source
STATUS_ID String Lead Status
ASSIGNED_BY_ID Int Responsible
PHONE_WORK String Work Phone
PHONE_MOBILE String Mobile
PHONE_FAX String Fax
PHONE_HOME String Home Phone
PHONE_PAGER String Pager
PHONE_OTHER String Other Phone
WEB_WORK String Corporate Site
WEB_HOME String Personal Site
WEB_FACEBOOK String Facebook Page
WEB_LIVEJOURNAL String LiveJournal Page
WEB_TWITTER String Twitter Account
WEB_OTHER String Other Site
EMAIL_WORK String Work E-mail
EMAIL_HOME String Personal E-mail
EMAIL_OTHER String Other E-mail
IM_SKYPE String Skype
IM_MSN String MSN/Live!
IM_JABBER String Jabber
IM_OTHER String Other Messenger
* - required parameter

The STATUS_ID , SOURCE_ID , CURRENCY_ID, and PRODUCT_ID parameters are selected from a corresponding directory of the CRM.

Below are tables with value sets of these parameters after installation of the module.
Important: values can be changed by the intranet administrator or deleted.

Table 3: STATUS_ID – Lead Statuses
Value Description
NEW Unassigned
ASSIGNED Responsible Assigned
DETAILS Waiting for Details
IN_PROCESS In Progress
JUNK Junk Lead
Table 4: SOURCE_ID – Sources
Value Description
SELF Personal Contact
PARTNER Existing Client
WEB Website
TRADE_SHOW Show/Exhibition
COMPANY Campaign
HR HR Department
MAIL E-Mail Message
Table 5: CURRENCY_ID – Currencies
Value Description
USD US Dollar
EUR Euro
Table 6: PRODUCT_ID – Products
Value Description
PRODUCT_1 Bitrix Site Manager
PRODUCT_2 Bitrix Intranet
Aside from the main fields, a lead may have additional custom fields created by the intranet administrator. They can also be passed to the page.

I’m including a file that contains an example script that can be used on your site to create forms and transfer data to the CRM.
Before using this file, you will need to open it and enter your Bitrix24 domain and an account of a user with the right to add a lead.

! We recommend using a separate user with access only to add leads and without access to anything else.
Most Popular
Enhancing Email Efficiency with Bitrix24 CoPilot Mail Assistant
Bitrix24 - A Game-Changer for Nonprofits - A Success Story from Teamexpansion
Bitrix24 CoPilot: Crafting Beautiful & Engaging Websites Made Easy
New Bitrix24 Helpdesk Channel on YouTube
New BI Builder In Bitrix24 CRM
You may also like

Free. Unlimited. Online.

Bitrix24 is a place where everyone can communicate, collaborate on tasks and projects, manage clients and do much more.

Start for free
You may also like
Product Properties In Deals
Bitrix24 tips and updates
Product Properties In Deals
2 min read
Bitrix24 Plans: Which One To Choose
Bitrix24 tips and updates
Bitrix24 Plans: Which One To Choose
5 min read