Lead form
A form with the fields you choose. Every submission becomes a contact (by phone, by email or new) and a pending ticket in the chosen department, with a message summarizing the answers.
Installation
Create it in Widgets > New widget > Lead form and paste the code:
<script src="https://widget.sendeasy.pro/form-widget.js" data-token="YOUR_TOKEN" data-backend-url="https://backend.sendeasy.app" defer></script>
Modes
- Floating button: a button in the corner opens the form.
- Automatic pop-up: opens by itself after the delay, once per visit.
- Inside the page: the form appears where you place
<div data-sendeasy-form></div>. You can also point to an element withdata-target="#my-element"on the script tag. Without the element, it falls back to the floating mode.
Fields
Available types: text, email, WhatsApp/phone, long text, option list and checkbox. Each field can be required. Name, email and WhatsApp become the contact details; the others go to the extra information.
Other settings
- Submit button text, message after submit and optional redirect.
- Consent (required checkbox with your text).
- Labels above the fields and brand in the footer.
- Appearance: main color, text color, background color, title, subtitle and position.
Using your own form
If the website already has its own form, it can post straight to the lead form, without the script. There is no secret and no server in between: the widget token is public and the request leaves from the browser.
- Create the lead form in the panel with the fields the website collects (for example name, email, WhatsApp and a long text field for the message) and choose the department that receives the tickets.
- Under Allowed websites, keep the website address (for example
https://mysite.com; subdomains such aswwwalso work). - On the website, read the widget fields and send the answers by each field
id:
const BACKEND = 'https://backend.sendeasy.app'
const TOKEN = 'YOUR_TOKEN' // widget token, in Widgets > your form > Token
// Fields configured in the panel: [{ id, type, label, required }, ...]
const config = await fetch(`${BACKEND}/widget/config`, {
headers: { 'x-widget-token': TOKEN },
}).then((r) => r.json())
const idOf = (type) => config.settings.fields.find((f) => f.type === type)?.id
const response = await fetch(`${BACKEND}/widget/form`, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'x-widget-token': TOKEN },
body: JSON.stringify({
values: {
[idOf('text')]: 'Mary Smith',
[idOf('email')]: 'mary@example.com',
[idOf('phone')]: '15551234567', // with country code
[idOf('textarea')]: 'I would like to know the Plus plan',
},
originUrl: window.location.href,
referrer: document.referrer,
language: navigator.language,
}),
})
// 201 { ok: true, ticketId, newContact }
If the field ids are fixed in your panel, you can skip GET /widget/config and send values directly.
Most common errors:
| Code | Meaning |
|---|---|
ERR_WIDGET_FORM_FIELD_REQUIRED (400) | A required field is missing. |
ERR_WIDGET_FORM_FIELD_INVALID (400) | Invalid email or phone format. |
ERR_WIDGET_ORIGIN_NOT_ALLOWED (403) | The page is not in Allowed websites (this includes localhost and preview addresses). |
ERR_WIDGET_TOKEN_INVALID (401) | Wrong or rotated token, or the widget is turned off. |
ERR_WIDGET_FORM_RATE_LIMIT (429) | Over the limits below. |
The form does not send an automatic message to the visitor: the ticket arrives pending in the department and an agent replies from the panel.
Limits
Per token: 10 submissions per minute. Per IP address: 20 submissions every 10 minutes.