LineDevelopers

Submit a lead form

POST/api/channels/webchat/forms/{publicKey}/{slug}/submit
No key. The public key and slug are the addressIdempotent with Idempotency-Key

Parameters

Idempotency-Keystringheader

Use the same 8–128 character letter/number/underscore/hyphen key when retrying a response. A duplicate returns 200 with the original submission ID.

publicKeystringpathrequired

The public key of the widget that owns the form.

slugstringpathrequired

The form's slug. The form must be active.

Request body

Use stable question keys and choice values. Legacy single-choice labels remain accepted without a session token. Phone numbers use the form’s default country. Hidden answers are removed. Required consent must be true. Requests must be under 512 KB.

valuesobjectrequired

Answers keyed by question key. Text/contact/date/choice: string; number: number; yes/no/consent: boolean; multiple choice: string array; repeater: answer-object array. Signature: {method: typed|drawn, name, accepted: true, strokes: [[[x,y],...],...]}; coordinates are normalised to 0–1. Drawn signatures require at least one stroke.

tokenstring

Signed session from the hosted form. Pins its published version and optional invite. Expires after 24 hours. Without it, the latest published version is used.

sessionTokenstring

Existing signed Web Chat session, if this form belongs to a current chat. It cannot override a form invite’s conversation.

turnstileTokenstring

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

sourceUrlstring · uri

Optional source page. Only its HTTP(S) origin and path are stored; query and fragment are removed.

Responses

200Already accepted. Returns ok, submissionId, and duplicate: true.
201The submission was accepted.
400Invalid request or failed security check.
401Invalid or expired signed session. Reload the form.
404No active form matches that public key and slug.
410The form is closed, the workspace is unavailable, or the invite expired.
413The request exceeds 512 KB.
422Answer validation failed. Each issue identifies a question key, including repeater row indexes.
429Rate limited. Back off and retry.
curl -X POST 'https://staging.useline.io/api/channels/webchat/forms/pk_live_2f8c/quote-request/submit' \
  -H 'Origin: https://example.com' \
  -H 'Content-Type: application/json' \
  -d '{
    "values": {
      "name": "Priya Shah",
      "phone": "020 7946 0000",
      "email": "priya@example.com",
      "need": "Boiler service quote"
    },
    "sourceUrl": "https://example.com/contact"
  }'
Response 201
{
  "ok": true,
  "submissionId": "9c2a1f77-4b18-4d0e-8a3d-51f0b7c9e412"
}