Embeddable lead form
Create a form under Settings → Lead capture, then paste its snippet into any page on your website:
<script src="https://agentlyleads.com/api/forms/YOUR_FORM_ID/embed.js" async></script>The script renders the form exactly where the tag sits, inside a Shadow DOM — its minimal, system-font styling never leaks into your page and your page's CSS never breaks the form.
What a submission does
Each submission lands in your Leads list via the same dedupe logic as POST /api/v1/leads:
- New email (or no email) → a new lead with status
NEW— yourLEAD/CREATEDworkflows fire (round-robin assignment, notifications, …). - Known email → the existing lead is updated with the non-empty submitted fields.
sourceis set toWeb form: <form name>and the page URL the form was embedded on is recorded as the source detail — so you always know which page converted.- A filled Message field is logged as a NOTE on the lead's timeline.
Configuring a form
| Setting | Effect |
|---|---|
| Fields | Any subset of Name, Email, Phone, Company, Message. Name is always included and required. |
| Success message | Shown in place of the form after a successful submission. |
| Allowed domains | One per line (e.g. example.com, *.example.com). When set, browsers may only submit from these domains — requests from other origins are blocked by CORS. Leave empty to allow any site. |
| Active | Pause a form without removing the snippet — a paused form's endpoint returns 404. |
No API key ships to the browser. The form's unguessable ID is the only capability, and it can only create leads — it cannot read anything back.
Spam protection
Three layers, all automatic:
- Honeypot — a hidden
websiteinput real users never see. Bots that fill it get a fake success response and the submission is silently dropped. - Time gate — the form stamps its render time; submissions arriving less than 2 seconds later are rejected.
- Rate limit — per-IP limiting on the public endpoint.
Posting without the widget
The public endpoint accepts JSON directly, so you can build your own UI against it:
curl -X POST https://agentlyleads.com/api/forms/YOUR_FORM_ID \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Buyer",
"email": "jane@acme.com",
"message": "Do you ship to Canada?",
"_t": 1753174800000,
"pageUrl": "https://your-site.com/contact"
}'_t— the epoch-milliseconds timestamp of when your form rendered (the 2-second gate is enforced against it).pageUrl— optional; recorded as the lead's source detail.- Only fields configured on the form are accepted; anything else is ignored.
Responses: 200 {"ok": true, "message": "<success message>"} · 400 readable validation error · 404 unknown or paused form · 429 rate limited.