Public lead form
Public lead capture forms
INFO
Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.
POST /public-lead-form/create
Create a new public lead capture form with custom fields, styling, and page settings.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
name | string | Да | Display name of the lead form |
organization_id | string | Да | Organization ObjectId the form belongs to |
responsible_id | string | Да | Responsible user ObjectId |
fields | object[] | Да | Ordered list of form elements (header, paragraph, line, logo, file, field) |
fields[].type | string | Да | Element type. Допустимые значения: header, paragraph, line, logo, file, field |
fields[].order | number | Да | Display order index |
fields[].name | string | Нет | Display name for the element |
fields[].placeholder | string | Нет | |
fields[].validation_type | string | Нет | Input validation rule (field elements only). Допустимые значения: phone, email |
fields[].is_required | boolean | Нет | |
fields[].color | string | Нет | |
fields[].bold | boolean | Нет | |
fields[].italic | boolean | Нет | |
fields[].underline | boolean | Нет | |
fields[].text_align | string | Нет | Допустимые значения: left, right, center |
fields[].size | number | Нет | |
fields[].error_message | string | Нет | |
fields[].custom_field_id | string | Нет | Custom field ObjectId (field elements only) |
page | object | Да | |
page.background_color | string | Да | Page background color (hex) |
page.background_image | string | Нет | Page background image URL (when background_type is image) |
page.background_type | string | Да | Допустимые значения: color, image |
page.description | string | Нет | |
page.header_active | boolean | Да | |
page.header_type | string | Да | Допустимые значения: text, image |
page.header_text | string | Да | |
page.header_text_color | string | Да | |
page.header_image | string | Нет | |
page.header_text_font_size | number | Да | |
page.margin_left | number | Да | |
page.margin_right | number | Да | |
page.margin_top | number | Да | |
page.position | string | Да | Допустимые значения: left, right, center |
settings | object | Да | |
settings.state_id | string | Нет | Default state ObjectId for submitted leads |
settings.autocomplete | boolean | Да | Auto-complete submitted leads |
settings.success_message | string | Нет | |
settings.has_redirect | boolean | Нет | |
settings.redirect_url | string | Нет | |
settings.redirect_delay | number | Нет | Redirect delay in milliseconds |
settings.submit | string | Нет | Submit button label |
settings.sidebar | object | Нет | |
settings.sidebar.fields | object | Нет | Map of sidebar field key to sidebar element |
settings.sidebar.width | number | Да | |
settings.sidebar.styles | object | Да | |
settings.sidebar.type | string | Да | Допустимые значения: left, right |
styles | object | Да | |
styles.field_margin | number | Да | |
styles.margin | boolean | Да | |
styles.field_background | string | Да | |
styles.field_border_color | string | Да | |
styles.field_form | string | Да | Допустимые значения: rounded, square, line |
styles.field_height | number | Да | |
styles.submit_background | string | Да | |
styles.submit_bold | boolean | Да | |
styles.submit_italic | boolean | Да | |
styles.submit_underline | boolean | Да | |
styles.submit_border_radius | string | Да | Допустимые значения: square, rounded |
styles.submit_color | string | Да | |
styles.submit_position | string | Да | Допустимые значения: left, right, center |
styles.submit_width | string | Да | Допустимые значения: full_width, own |
styles.width | number | Да | |
styles.height | number | Да | |
styles.form_border_color | string | Да | |
styles.form_border_radius | number | Да | |
styles.font | string | Да | |
styles.font_color | string | Да | |
styles.font_size | number | Да | |
styles.form_paddings | boolean | Да | |
styles.form_shadow | boolean | Да | |
styles.background | string | Да | |
styles.background_type | string | Да | Допустимые значения: color, image |
styles.name_position | string | Да | Допустимые значения: left, top |
css | string | Нет | Optional custom CSS overrides |
{
"name": "string",
"organization_id": "string",
"responsible_id": "string",
"fields": [
{
"type": "header",
"order": 0,
"name": "string",
"placeholder": "string",
"validation_type": "phone",
"is_required": false,
"color": "string",
"bold": false,
"italic": false,
"underline": false,
"text_align": "left",
"size": 0,
"error_message": "string",
"custom_field_id": "string"
}
],
"page": {
"background_color": "string",
"background_image": "string",
"background_type": "color",
"description": "string",
"header_active": false,
"header_type": "text",
"header_text": "string",
"header_text_color": "string",
"header_image": "string",
"header_text_font_size": 0,
"margin_left": 0,
"margin_right": 0,
"margin_top": 0,
"position": "left"
},
"settings": {
"state_id": "string",
"autocomplete": false,
"success_message": "string",
"has_redirect": false,
"redirect_url": "string",
"redirect_delay": 0,
"submit": "string",
"sidebar": {
"fields": {},
"width": 0,
"styles": {
"background_color": null,
"background_image": null
},
"type": "left"
}
},
"styles": {
"field_margin": 0,
"margin": false,
"field_background": "string",
"field_border_color": "string",
"field_form": "rounded",
"field_height": 0,
"submit_background": "string",
"submit_bold": false,
"submit_italic": false,
"submit_underline": false,
"submit_border_radius": "square",
"submit_color": "string",
"submit_position": "left",
"submit_width": "full_width",
"width": 0,
"height": 0,
"form_border_color": "string",
"form_border_radius": 0,
"font": "string",
"font_color": "string",
"font_size": 0,
"form_paddings": false,
"form_shadow": false,
"background": "string",
"background_type": "color",
"name_position": "left"
},
"css": "string"
}Ответ
| Поле | Тип | Описание |
|---|---|---|
name | string | Display name of the lead form |
organization_id | string | Organization ObjectId the form belongs to |
responsible_id | string | Responsible user ObjectId |
fields | object[] | Ordered list of form elements (header, paragraph, line, logo, file, field) |
fields[].type | string | Element type. Допустимые значения: header, paragraph, line, logo, file, field |
fields[].order | number | Display order index |
fields[].name | string | Display name for the element |
fields[].placeholder | string | |
fields[].validation_type | string | Input validation rule (field elements only). Допустимые значения: phone, email |
fields[].is_required | boolean | |
fields[].color | string | |
fields[].bold | boolean | |
fields[].italic | boolean | |
fields[].underline | boolean | |
fields[].text_align | string | Допустимые значения: left, right, center |
fields[].size | number | |
fields[].error_message | string | |
fields[].custom_field_id | string | Custom field ObjectId (field elements only) |
page | object | |
page.background_color | string | Page background color (hex) |
page.background_image | string | Page background image URL (when background_type is image) |
page.background_type | string | Допустимые значения: color, image |
page.description | string | |
page.header_active | boolean | |
page.header_type | string | Допустимые значения: text, image |
page.header_text | string | |
page.header_text_color | string | |
page.header_image | string | |
page.header_text_font_size | number | |
page.margin_left | number | |
page.margin_right | number | |
page.margin_top | number | |
page.position | string | Допустимые значения: left, right, center |
settings | object | |
settings.state_id | string | Default state ObjectId for submitted leads |
settings.autocomplete | boolean | Auto-complete submitted leads |
settings.success_message | string | |
settings.has_redirect | boolean | |
settings.redirect_url | string | |
settings.redirect_delay | number | Redirect delay in milliseconds |
settings.submit | string | Submit button label |
settings.sidebar | object | |
settings.sidebar.fields | object | Map of sidebar field key to sidebar element |
settings.sidebar.width | number | |
settings.sidebar.styles | object | |
settings.sidebar.type | string | Допустимые значения: left, right |
styles | object | |
styles.field_margin | number | |
styles.margin | boolean | |
styles.field_background | string | |
styles.field_border_color | string | |
styles.field_form | string | Допустимые значения: rounded, square, line |
styles.field_height | number | |
styles.submit_background | string | |
styles.submit_bold | boolean | |
styles.submit_italic | boolean | |
styles.submit_underline | boolean | |
styles.submit_border_radius | string | Допустимые значения: square, rounded |
styles.submit_color | string | |
styles.submit_position | string | Допустимые значения: left, right, center |
styles.submit_width | string | Допустимые значения: full_width, own |
styles.width | number | |
styles.height | number | |
styles.form_border_color | string | |
styles.form_border_radius | number | |
styles.font | string | |
styles.font_color | string | |
styles.font_size | number | |
styles.form_paddings | boolean | |
styles.form_shadow | boolean | |
styles.background | string | |
styles.background_type | string | Допустимые значения: color, image |
styles.name_position | string | Допустимые значения: left, top |
css | string | Optional custom CSS overrides |
_id | string | Public lead form ObjectId |
is_deleted | boolean | Soft-delete flag |
created_at | string (date-time) | Creation timestamp (ISO 8601) |
updated_at | string (date-time) | Last update timestamp (ISO 8601) |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"name": "string",
"organization_id": "string",
"responsible_id": "string",
"fields": [
{
"type": "header",
"order": 0,
"name": "string",
"placeholder": "string",
"validation_type": "phone",
"is_required": false,
"color": "string",
"bold": false,
"italic": false,
"underline": false,
"text_align": "left",
"size": 0,
"error_message": "string",
"custom_field_id": "string"
}
],
"page": {
"background_color": "string",
"background_image": "string",
"background_type": "color",
"description": "string",
"header_active": false,
"header_type": "text",
"header_text": "string",
"header_text_color": "string",
"header_image": "string",
"header_text_font_size": 0,
"margin_left": 0,
"margin_right": 0,
"margin_top": 0,
"position": "left"
},
"settings": {
"state_id": "string",
"autocomplete": false,
"success_message": "string",
"has_redirect": false,
"redirect_url": "string",
"redirect_delay": 0,
"submit": "string",
"sidebar": {
"fields": {},
"width": 0,
"styles": {
"background_color": null,
"background_image": null
},
"type": "left"
}
},
"styles": {
"field_margin": 0,
"margin": false,
"field_background": "string",
"field_border_color": "string",
"field_form": "rounded",
"field_height": 0,
"submit_background": "string",
"submit_bold": false,
"submit_italic": false,
"submit_underline": false,
"submit_border_radius": "square",
"submit_color": "string",
"submit_position": "left",
"submit_width": "full_width",
"width": 0,
"height": 0,
"form_border_color": "string",
"form_border_radius": 0,
"font": "string",
"font_color": "string",
"font_size": 0,
"form_paddings": false,
"form_shadow": false,
"background": "string",
"background_type": "color",
"name_position": "left"
},
"css": "string",
"_id": "string",
"is_deleted": false,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
},
"time": "2025-05-01T12:00:00Z"
}PUT /public-lead-form/update/{id}
Update an existing public lead form by its ObjectId.
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | Lead form ObjectId |
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
name | string | Да | Display name of the lead form |
organization_id | string | Да | Organization ObjectId the form belongs to |
responsible_id | string | Да | Responsible user ObjectId |
fields | object[] | Да | Ordered list of form elements (header, paragraph, line, logo, file, field) |
fields[].type | string | Да | Element type. Допустимые значения: header, paragraph, line, logo, file, field |
fields[].order | number | Да | Display order index |
fields[].name | string | Нет | Display name for the element |
fields[].placeholder | string | Нет | |
fields[].validation_type | string | Нет | Input validation rule (field elements only). Допустимые значения: phone, email |
fields[].is_required | boolean | Нет | |
fields[].color | string | Нет | |
fields[].bold | boolean | Нет | |
fields[].italic | boolean | Нет | |
fields[].underline | boolean | Нет | |
fields[].text_align | string | Нет | Допустимые значения: left, right, center |
fields[].size | number | Нет | |
fields[].error_message | string | Нет | |
fields[].custom_field_id | string | Нет | Custom field ObjectId (field elements only) |
page | object | Да | |
page.background_color | string | Да | Page background color (hex) |
page.background_image | string | Нет | Page background image URL (when background_type is image) |
page.background_type | string | Да | Допустимые значения: color, image |
page.description | string | Нет | |
page.header_active | boolean | Да | |
page.header_type | string | Да | Допустимые значения: text, image |
page.header_text | string | Да | |
page.header_text_color | string | Да | |
page.header_image | string | Нет | |
page.header_text_font_size | number | Да | |
page.margin_left | number | Да | |
page.margin_right | number | Да | |
page.margin_top | number | Да | |
page.position | string | Да | Допустимые значения: left, right, center |
settings | object | Да | |
settings.state_id | string | Нет | Default state ObjectId for submitted leads |
settings.autocomplete | boolean | Да | Auto-complete submitted leads |
settings.success_message | string | Нет | |
settings.has_redirect | boolean | Нет | |
settings.redirect_url | string | Нет | |
settings.redirect_delay | number | Нет | Redirect delay in milliseconds |
settings.submit | string | Нет | Submit button label |
settings.sidebar | object | Нет | |
settings.sidebar.fields | object | Нет | Map of sidebar field key to sidebar element |
settings.sidebar.width | number | Да | |
settings.sidebar.styles | object | Да | |
settings.sidebar.type | string | Да | Допустимые значения: left, right |
styles | object | Да | |
styles.field_margin | number | Да | |
styles.margin | boolean | Да | |
styles.field_background | string | Да | |
styles.field_border_color | string | Да | |
styles.field_form | string | Да | Допустимые значения: rounded, square, line |
styles.field_height | number | Да | |
styles.submit_background | string | Да | |
styles.submit_bold | boolean | Да | |
styles.submit_italic | boolean | Да | |
styles.submit_underline | boolean | Да | |
styles.submit_border_radius | string | Да | Допустимые значения: square, rounded |
styles.submit_color | string | Да | |
styles.submit_position | string | Да | Допустимые значения: left, right, center |
styles.submit_width | string | Да | Допустимые значения: full_width, own |
styles.width | number | Да | |
styles.height | number | Да | |
styles.form_border_color | string | Да | |
styles.form_border_radius | number | Да | |
styles.font | string | Да | |
styles.font_color | string | Да | |
styles.font_size | number | Да | |
styles.form_paddings | boolean | Да | |
styles.form_shadow | boolean | Да | |
styles.background | string | Да | |
styles.background_type | string | Да | Допустимые значения: color, image |
styles.name_position | string | Да | Допустимые значения: left, top |
css | string | Нет | Optional custom CSS overrides |
_id | string | Да | Lead form ObjectId to update |
{
"name": "string",
"organization_id": "string",
"responsible_id": "string",
"fields": [
{
"type": "header",
"order": 0,
"name": "string",
"placeholder": "string",
"validation_type": "phone",
"is_required": false,
"color": "string",
"bold": false,
"italic": false,
"underline": false,
"text_align": "left",
"size": 0,
"error_message": "string",
"custom_field_id": "string"
}
],
"page": {
"background_color": "string",
"background_image": "string",
"background_type": "color",
"description": "string",
"header_active": false,
"header_type": "text",
"header_text": "string",
"header_text_color": "string",
"header_image": "string",
"header_text_font_size": 0,
"margin_left": 0,
"margin_right": 0,
"margin_top": 0,
"position": "left"
},
"settings": {
"state_id": "string",
"autocomplete": false,
"success_message": "string",
"has_redirect": false,
"redirect_url": "string",
"redirect_delay": 0,
"submit": "string",
"sidebar": {
"fields": {},
"width": 0,
"styles": {
"background_color": null,
"background_image": null
},
"type": "left"
}
},
"styles": {
"field_margin": 0,
"margin": false,
"field_background": "string",
"field_border_color": "string",
"field_form": "rounded",
"field_height": 0,
"submit_background": "string",
"submit_bold": false,
"submit_italic": false,
"submit_underline": false,
"submit_border_radius": "square",
"submit_color": "string",
"submit_position": "left",
"submit_width": "full_width",
"width": 0,
"height": 0,
"form_border_color": "string",
"form_border_radius": 0,
"font": "string",
"font_color": "string",
"font_size": 0,
"form_paddings": false,
"form_shadow": false,
"background": "string",
"background_type": "color",
"name_position": "left"
},
"css": "string",
"_id": "string"
}Ответ
Структура ответа совпадает с POST /public-lead-form/create.
GET /public-lead-form/get-by-id/{id}
Fetch a single public lead form by its ObjectId.
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | Lead form ObjectId |
Тело запроса
Тело запроса не требуется.
Ответ
Структура ответа совпадает с POST /public-lead-form/create.
POST /public-lead-form/get-paging
Paginated list of public lead forms, optionally filtered by organization.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
page | number | Да | По умолчанию: 1 |
limit | number | Да | По умолчанию: 20 |
organization_id | string | Нет | Filter by organization ObjectId |
{
"page": 1,
"limit": 20,
"organization_id": "string"
}Ответ
| Поле | Тип | Описание |
|---|---|---|
total | number | |
list | object[] | |
list[].name | string | Display name of the lead form |
list[].organization_id | string | Organization ObjectId the form belongs to |
list[].responsible_id | string | Responsible user ObjectId |
list[].fields | object[] | Ordered list of form elements (header, paragraph, line, logo, file, field) |
list[].fields[].type | string | Element type. Допустимые значения: header, paragraph, line, logo, file, field |
list[].fields[].order | number | Display order index |
list[].fields[].name | string | Display name for the element |
list[].fields[].placeholder | string | |
list[].fields[].validation_type | string | Input validation rule (field elements only). Допустимые значения: phone, email |
list[].fields[].is_required | boolean | |
list[].fields[].color | string | |
list[].fields[].bold | boolean | |
list[].fields[].italic | boolean | |
list[].fields[].underline | boolean | |
list[].fields[].text_align | string | Допустимые значения: left, right, center |
list[].fields[].size | number | |
list[].fields[].error_message | string | |
list[].fields[].custom_field_id | string | Custom field ObjectId (field elements only) |
list[].page | object | |
list[].page.background_color | string | Page background color (hex) |
list[].page.background_image | string | Page background image URL (when background_type is image) |
list[].page.background_type | string | Допустимые значения: color, image |
list[].page.description | string | |
list[].page.header_active | boolean | |
list[].page.header_type | string | Допустимые значения: text, image |
list[].page.header_text | string | |
list[].page.header_text_color | string | |
list[].page.header_image | string | |
list[].page.header_text_font_size | number | |
list[].page.margin_left | number | |
list[].page.margin_right | number | |
list[].page.margin_top | number | |
list[].page.position | string | Допустимые значения: left, right, center |
list[].settings | object | |
list[].settings.state_id | string | Default state ObjectId for submitted leads |
list[].settings.autocomplete | boolean | Auto-complete submitted leads |
list[].settings.success_message | string | |
list[].settings.has_redirect | boolean | |
list[].settings.redirect_url | string | |
list[].settings.redirect_delay | number | Redirect delay in milliseconds |
list[].settings.submit | string | Submit button label |
list[].settings.sidebar | object | |
list[].styles | object | |
list[].styles.field_margin | number | |
list[].styles.margin | boolean | |
list[].styles.field_background | string | |
list[].styles.field_border_color | string | |
list[].styles.field_form | string | Допустимые значения: rounded, square, line |
list[].styles.field_height | number | |
list[].styles.submit_background | string | |
list[].styles.submit_bold | boolean | |
list[].styles.submit_italic | boolean | |
list[].styles.submit_underline | boolean | |
list[].styles.submit_border_radius | string | Допустимые значения: square, rounded |
list[].styles.submit_color | string | |
list[].styles.submit_position | string | Допустимые значения: left, right, center |
list[].styles.submit_width | string | Допустимые значения: full_width, own |
list[].styles.width | number | |
list[].styles.height | number | |
list[].styles.form_border_color | string | |
list[].styles.form_border_radius | number | |
list[].styles.font | string | |
list[].styles.font_color | string | |
list[].styles.font_size | number | |
list[].styles.form_paddings | boolean | |
list[].styles.form_shadow | boolean | |
list[].styles.background | string | |
list[].styles.background_type | string | Допустимые значения: color, image |
list[].styles.name_position | string | Допустимые значения: left, top |
list[].css | string | Optional custom CSS overrides |
list[]._id | string | Public lead form ObjectId |
list[].is_deleted | boolean | Soft-delete flag |
list[].created_at | string (date-time) | Creation timestamp (ISO 8601) |
list[].updated_at | string (date-time) | Last update timestamp (ISO 8601) |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"list": [
{
"name": "string",
"organization_id": "string",
"responsible_id": "string",
"fields": [],
"page": {
"background_color": null,
"background_image": null,
"background_type": null,
"description": null,
"header_active": null,
"header_type": null,
"header_text": null,
"header_text_color": null,
"header_image": null,
"header_text_font_size": null,
"margin_left": null,
"margin_right": null,
"margin_top": null,
"position": null
},
"settings": {
"state_id": null,
"autocomplete": null,
"success_message": null,
"has_redirect": null,
"redirect_url": null,
"redirect_delay": null,
"submit": null,
"sidebar": null
},
"styles": {
"field_margin": null,
"margin": null,
"field_background": null,
"field_border_color": null,
"field_form": null,
"field_height": null,
"submit_background": null,
"submit_bold": null,
"submit_italic": null,
"submit_underline": null,
"submit_border_radius": null,
"submit_color": null,
"submit_position": null,
"submit_width": null,
"width": null,
"height": null,
"form_border_color": null,
"form_border_radius": null,
"font": null,
"font_color": null,
"font_size": null,
"form_paddings": null,
"form_shadow": null,
"background": null,
"background_type": null,
"name_position": null
},
"css": "string",
"_id": "string",
"is_deleted": false,
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
}
]
},
"time": "2025-05-01T12:00:00Z"
}DELETE /public-lead-form/delete/{id}
Soft-delete a public lead form by its ObjectId.
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | Lead form ObjectId to delete |
Тело запроса
Тело запроса не требуется.
Ответ
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "ok",
"time": "2025-05-01T12:00:00Z"
}Эта страница сгенерирована из спецификации OpenAPI.