Public lead form
Public lead capture forms
INFO
Every response arrives in the shared envelope — code, message, messages, status_code, time — with the payload in data. The tables below describe what is inside data.
POST /public-lead-form/create
Create a new public lead capture form with custom fields, styling, and page settings.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name of the lead form |
organization_id | string | Yes | Organization ObjectId the form belongs to |
responsible_id | string | Yes | Responsible user ObjectId |
fields | object[] | Yes | Ordered list of form elements (header, paragraph, line, logo, file, field) |
fields[].type | string | Yes | Element type. One of: header, paragraph, line, logo, file, field |
fields[].order | number | Yes | Display order index |
fields[].name | string | No | Display name for the element |
fields[].placeholder | string | No | |
fields[].validation_type | string | No | Input validation rule (field elements only). One of: phone, email |
fields[].is_required | boolean | No | |
fields[].color | string | No | |
fields[].bold | boolean | No | |
fields[].italic | boolean | No | |
fields[].underline | boolean | No | |
fields[].text_align | string | No | One of: left, right, center |
fields[].size | number | No | |
fields[].error_message | string | No | |
fields[].custom_field_id | string | No | Custom field ObjectId (field elements only) |
page | object | Yes | |
page.background_color | string | Yes | Page background color (hex) |
page.background_image | string | No | Page background image URL (when background_type is image) |
page.background_type | string | Yes | One of: color, image |
page.description | string | No | |
page.header_active | boolean | Yes | |
page.header_type | string | Yes | One of: text, image |
page.header_text | string | Yes | |
page.header_text_color | string | Yes | |
page.header_image | string | No | |
page.header_text_font_size | number | Yes | |
page.margin_left | number | Yes | |
page.margin_right | number | Yes | |
page.margin_top | number | Yes | |
page.position | string | Yes | One of: left, right, center |
settings | object | Yes | |
settings.state_id | string | No | Default state ObjectId for submitted leads |
settings.autocomplete | boolean | Yes | Auto-complete submitted leads |
settings.success_message | string | No | |
settings.has_redirect | boolean | No | |
settings.redirect_url | string | No | |
settings.redirect_delay | number | No | Redirect delay in milliseconds |
settings.submit | string | No | Submit button label |
settings.sidebar | object | No | |
settings.sidebar.fields | object | No | Map of sidebar field key to sidebar element |
settings.sidebar.width | number | Yes | |
settings.sidebar.styles | object | Yes | |
settings.sidebar.type | string | Yes | One of: left, right |
styles | object | Yes | |
styles.field_margin | number | Yes | |
styles.margin | boolean | Yes | |
styles.field_background | string | Yes | |
styles.field_border_color | string | Yes | |
styles.field_form | string | Yes | One of: rounded, square, line |
styles.field_height | number | Yes | |
styles.submit_background | string | Yes | |
styles.submit_bold | boolean | Yes | |
styles.submit_italic | boolean | Yes | |
styles.submit_underline | boolean | Yes | |
styles.submit_border_radius | string | Yes | One of: square, rounded |
styles.submit_color | string | Yes | |
styles.submit_position | string | Yes | One of: left, right, center |
styles.submit_width | string | Yes | One of: full_width, own |
styles.width | number | Yes | |
styles.height | number | Yes | |
styles.form_border_color | string | Yes | |
styles.form_border_radius | number | Yes | |
styles.font | string | Yes | |
styles.font_color | string | Yes | |
styles.font_size | number | Yes | |
styles.form_paddings | boolean | Yes | |
styles.form_shadow | boolean | Yes | |
styles.background | string | Yes | |
styles.background_type | string | Yes | One of: color, image |
styles.name_position | string | Yes | One of: left, top |
css | string | No | 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"
}Response
| Field | Type | Description |
|---|---|---|
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. One of: 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). One of: phone, email |
fields[].is_required | boolean | |
fields[].color | string | |
fields[].bold | boolean | |
fields[].italic | boolean | |
fields[].underline | boolean | |
fields[].text_align | string | One of: 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 | One of: color, image |
page.description | string | |
page.header_active | boolean | |
page.header_type | string | One of: 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 | One of: 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 | One of: left, right |
styles | object | |
styles.field_margin | number | |
styles.margin | boolean | |
styles.field_background | string | |
styles.field_border_color | string | |
styles.field_form | string | One of: 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 | One of: square, rounded |
styles.submit_color | string | |
styles.submit_position | string | One of: left, right, center |
styles.submit_width | string | One of: 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 | One of: color, image |
styles.name_position | string | One of: 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.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Lead form ObjectId |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Display name of the lead form |
organization_id | string | Yes | Organization ObjectId the form belongs to |
responsible_id | string | Yes | Responsible user ObjectId |
fields | object[] | Yes | Ordered list of form elements (header, paragraph, line, logo, file, field) |
fields[].type | string | Yes | Element type. One of: header, paragraph, line, logo, file, field |
fields[].order | number | Yes | Display order index |
fields[].name | string | No | Display name for the element |
fields[].placeholder | string | No | |
fields[].validation_type | string | No | Input validation rule (field elements only). One of: phone, email |
fields[].is_required | boolean | No | |
fields[].color | string | No | |
fields[].bold | boolean | No | |
fields[].italic | boolean | No | |
fields[].underline | boolean | No | |
fields[].text_align | string | No | One of: left, right, center |
fields[].size | number | No | |
fields[].error_message | string | No | |
fields[].custom_field_id | string | No | Custom field ObjectId (field elements only) |
page | object | Yes | |
page.background_color | string | Yes | Page background color (hex) |
page.background_image | string | No | Page background image URL (when background_type is image) |
page.background_type | string | Yes | One of: color, image |
page.description | string | No | |
page.header_active | boolean | Yes | |
page.header_type | string | Yes | One of: text, image |
page.header_text | string | Yes | |
page.header_text_color | string | Yes | |
page.header_image | string | No | |
page.header_text_font_size | number | Yes | |
page.margin_left | number | Yes | |
page.margin_right | number | Yes | |
page.margin_top | number | Yes | |
page.position | string | Yes | One of: left, right, center |
settings | object | Yes | |
settings.state_id | string | No | Default state ObjectId for submitted leads |
settings.autocomplete | boolean | Yes | Auto-complete submitted leads |
settings.success_message | string | No | |
settings.has_redirect | boolean | No | |
settings.redirect_url | string | No | |
settings.redirect_delay | number | No | Redirect delay in milliseconds |
settings.submit | string | No | Submit button label |
settings.sidebar | object | No | |
settings.sidebar.fields | object | No | Map of sidebar field key to sidebar element |
settings.sidebar.width | number | Yes | |
settings.sidebar.styles | object | Yes | |
settings.sidebar.type | string | Yes | One of: left, right |
styles | object | Yes | |
styles.field_margin | number | Yes | |
styles.margin | boolean | Yes | |
styles.field_background | string | Yes | |
styles.field_border_color | string | Yes | |
styles.field_form | string | Yes | One of: rounded, square, line |
styles.field_height | number | Yes | |
styles.submit_background | string | Yes | |
styles.submit_bold | boolean | Yes | |
styles.submit_italic | boolean | Yes | |
styles.submit_underline | boolean | Yes | |
styles.submit_border_radius | string | Yes | One of: square, rounded |
styles.submit_color | string | Yes | |
styles.submit_position | string | Yes | One of: left, right, center |
styles.submit_width | string | Yes | One of: full_width, own |
styles.width | number | Yes | |
styles.height | number | Yes | |
styles.form_border_color | string | Yes | |
styles.form_border_radius | number | Yes | |
styles.font | string | Yes | |
styles.font_color | string | Yes | |
styles.font_size | number | Yes | |
styles.form_paddings | boolean | Yes | |
styles.form_shadow | boolean | Yes | |
styles.background | string | Yes | |
styles.background_type | string | Yes | One of: color, image |
styles.name_position | string | Yes | One of: left, top |
css | string | No | Optional custom CSS overrides |
_id | string | Yes | 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"
}Response
Same response shape as POST /public-lead-form/create.
GET /public-lead-form/get-by-id/{id}
Fetch a single public lead form by its ObjectId.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Lead form ObjectId |
Request body
No request body.
Response
Same response shape as POST /public-lead-form/create.
POST /public-lead-form/get-paging
Paginated list of public lead forms, optionally filtered by organization.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
page | number | Yes | Default: 1 |
limit | number | Yes | Default: 20 |
organization_id | string | No | Filter by organization ObjectId |
{
"page": 1,
"limit": 20,
"organization_id": "string"
}Response
| Field | Type | Description |
|---|---|---|
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. One of: 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). One of: 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 | One of: 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 | One of: color, image |
list[].page.description | string | |
list[].page.header_active | boolean | |
list[].page.header_type | string | One of: 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 | One of: 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 | One of: 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 | One of: square, rounded |
list[].styles.submit_color | string | |
list[].styles.submit_position | string | One of: left, right, center |
list[].styles.submit_width | string | One of: 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 | One of: color, image |
list[].styles.name_position | string | One of: 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.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Lead form ObjectId to delete |
Request body
No request body.
Response
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "ok",
"time": "2025-05-01T12:00:00Z"
}This page is generated from the OpenAPI spec.