Skip to main content
POST
/
v1
/
chatbots
/
chatbot
/
{chatbotId}
/
lead-settings
Create Lead Settings
curl --request POST \
  --url https://interhemispheric-unwet-paulene.ngrok-free.dev/api/v1/chatbots/chatbot/{chatbotId}/lead-settings \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "enableLeadCollection": true,
  "customerNameTake": true,
  "customerPhoneTake": true,
  "customerEmailTake": true,
  "industryTemplate": "<string>",
  "whenToCollectLead": "<string>",
  "customerTriggerKeywords": "<string>",
  "bookingIntegration": true,
  "bookingIntegrationLink": "<string>",
  "leadNotification": true,
  "leadNotificationEmail": [
    "<string>"
  ],
  "customerFormField": {},
  "autoEscalateOnLeadCapture": true
}
'
{
  "success": true,
  "message": "Lead settings created successfully",
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "chatbotId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "enableLeadCollection": false,
    "customerNameTake": false,
    "customerPhoneTake": false,
    "customerEmailTake": true,
    "industryTemplate": "<string>",
    "whenToCollectLead": "<string>",
    "customerTriggerKeywords": "<string>",
    "bookingIntegration": false,
    "bookingIntegrationLink": "<string>",
    "leadNotification": false,
    "leadNotificationEmail": [
      "<string>"
    ],
    "customerFormField": {},
    "autoEscalateOnLeadCapture": false,
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

customerFormField

customerFormField is an array of custom form field objects that appear in the lead capture form alongside the built-in name/email/phone fields. Each object in the array has the following shape:
PropertyTypeRequiredDescription
display_labelstringYesThe label shown to the user above the field
field_namestringYesInternal key used to store the value (snake_case, e.g. company_name)
field_typestringYesInput type — one of "text", "textarea", "email", "phone"
requiredbooleanYesWhether the field is mandatory before form submission
placeholder_textstringNoPlaceholder hint shown inside the input
optionsstringNoReserved for future use; pass an empty string ""

Example

"customerFormField": [
  {
    "display_label": "Company Name",
    "field_name": "company_name",
    "field_type": "text",
    "required": true,
    "placeholder_text": "e.g. Acme Corp",
    "options": ""
  },
  {
    "display_label": "Reason for Visit",
    "field_name": "reason_for_visit",
    "field_type": "textarea",
    "required": false,
    "placeholder_text": "Briefly describe your reason for contacting us",
    "options": ""
  }
]
Fields with an empty display_label are ignored by the chatbot UI and will not be rendered in the form preview.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

chatbotId
string
required

Body

application/json

All fields are optional. Only provided fields are applied.

enableLeadCollection
boolean
customerNameTake
boolean
customerPhoneTake
boolean
customerEmailTake
boolean
industryTemplate
string
whenToCollectLead
string
customerTriggerKeywords
string
bookingIntegration
boolean
leadNotification
boolean
leadNotificationEmail
string[]
customerFormField
object
autoEscalateOnLeadCapture
boolean

Response

Created

success
boolean
Example:

true

message
string
Example:

"Lead settings created successfully"

data
object