Lead Forms API

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
post/api/channels/webchat/forms/{publicKey}/{slug}/submit
Submit a lead form

Parameters

publicKeypath · stringrequired

The public key of the widget that owns the form.

slugpath · stringrequired

The 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.

valuesobjectrequired

Answers, keyed by field key. Each value is a string.

turnstileTokenstring

Cloudflare Turnstile token. Required when the tenant has Turnstile enabled.

sourceUrlstring · uri

The 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

201The submission was accepted.application/json
okbooleanrequired
submissionIdstring · 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. error names 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"}'