Submit a hosted lead form. Line creates the contact, opens a conversation, and fires the form's workflow trigger.
Submit a Line lead form from your own front end.
One call does the whole job: Line validates the values against the form the tenant built, finds or creates the contact by phone or email, opens a conversation in the shared inbox, and fires the form's workflow trigger.
The endpoint is unauthenticated — the form's public key and slug are the address. Abuse is held back by per-IP rate limits and, when the tenant has configured it, a Cloudflare Turnstile check.
Base URL
https://useline.io
/api/channels/webchat/forms/{publicKey}/{slug}/submitParameters
publicKeypath · stringrequiredThe public key of the widget that owns the form.
slugpath · stringrequiredThe form's slug. The form must be active.
Request body
values is keyed by the form's own field keys. Required fields must be non-empty, select fields must match one of their options, and phone must be a valid number — UK is assumed when no country code is given.
valuesobjectrequiredAnswers, keyed by field key. Each value is a string.
turnstileTokenstringCloudflare Turnstile token. Required when the tenant has Turnstile enabled.
sourceUrlstring · uriThe page the form was submitted from.
{
"values": {
"name": "Priya Shah",
"phone": "07700 900123",
"email": "priya@example.com",
"need": "Boiler service quote"
},
"sourceUrl": "https://example.com/contact"
}Response
okbooleanrequiredsubmissionIdstring · uuidrequired{
"ok": true,
"submissionId": "9c2a1f77-4b18-4d0e-8a3d-51f0b7c9e412"
}Errors
- 400
- A required field is empty, a value is invalid, or the security check failed.
errornames the field. - 404
- No active form matches that public key and slug.
- 429
- Rate limited. Back off and retry.
Example request
curl -X POST 'https://useline.io/api/channels/webchat/forms/:publicKey/:slug/submit' \
-H 'Origin: https://example.com' \
-H 'Content-Type: application/json' \
-d '{"values":{"name":"Priya Shah","phone":"07700 900123","email":"priya@example.com","need":"Boiler service quote"},"sourceUrl":"https://example.com/contact"}'