Submit a lead form
/api/channels/webchat/forms/{publicKey}/{slug}/submitParameters
Idempotency-KeystringheaderUse the same 8–128 character letter/number/underscore/hyphen key when retrying a response. A duplicate returns 200 with the original submission ID.
publicKeystringpathrequiredThe public key of the widget that owns the form.
slugstringpathrequiredThe 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.
valuesobjectrequiredAnswers 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.
tokenstringSigned session from the hosted form. Pins its published version and optional invite. Expires after 24 hours. Without it, the latest published version is used.
sessionTokenstringExisting signed Web Chat session, if this form belongs to a current chat. It cannot override a form invite’s conversation.
turnstileTokenstringCloudflare Turnstile token. Required when the tenant has Turnstile enabled.
sourceUrlstring · uriOptional 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"
}'{
"ok": true,
"submissionId": "9c2a1f77-4b18-4d0e-8a3d-51f0b7c9e412"
}