Two ways to integrate: a copy–paste snippet for low/no‑code sites, or the JSON API for developers and SPAs. Choose what fits your stack.
Best for static sites, CMS pages (WordPress, Webflow, Squarespace), or when you don’t control the submit code. Automatically intercepts forms and protects against low‑quality submissions.
</body>
on the page you want to protect.<script src="https://www.leadsward.com/leadsward-snippet.js"
data-api-key="YOUR_PUBLIC_API_KEY"
data-blocking-mode="redirect"
data-auto-intercept="true"
data-success-nav="submit"
defer></script>
SPA/React? Set data-auto-intercept="false"
and call window.leadsward.scoreSubmission(values)
yourself, or use our SDKs.
Static thank‑you page that does not accept POST? Use data-success-nav="location"
to perform a GET navigation to your form action after scoring, preventing HTTP 405 errors.
Use the JSON API from SPAs, Next.js/Remix, or your backend. Full control over UX, idempotency, and error handling.
POST https://www.leadsward.com/api/score
Authorization: Bearer <your_api_key>
Content-Type: application/json
Send your submission as arbitrary JSON. We auto‑extract email
,phone
, and message
(robust nested support).
{
"name": "Jane Doe",
"email": "jane@company.com",
"phone": "+15551234567",
"message": "We need a demo next week."
}
{
"score": 72,
"threshold": 40,
"decision": {
"conclusion": "ALLOW",
"reason": "LEGITIMATE_TRAFFIC",
"details": ["Valid email", "Good message length"]
}
}
curl -X POST https://www.leadsward.com/api/score -H "Authorization: Bearer lw_your_api_key_here" -H "Content-Type: application/json" -d '{
"name": "Jane Doe",
"email": "jane@company.com",
"phone": "+15551234567",
"message": "We need a demo next week."
}'
Optional: add Idempotency-Key
for safe retries (recommended for SPAs and flaky networks).
curl -X POST https://www.leadsward.com/api/score -H "Authorization: Bearer lw_your_api_key_here" -H "Content-Type: application/json" -H "Idempotency-Key: req-123" -d '{"email":"jane@company.com","phone":"+15551234567","message":"Demo next week."}'
Create and manage keys in the dashboard: Dashboard → API Keys
Use case | Snippet | API |
---|---|---|
Static/CMS pages | ✅ | ✅ |
React/SPA custom UX | ➖ (disable auto‑intercept) | ✅ (recommended) |
Idempotent retries | ➖ | ✅ |
Fastest time‑to‑value | ✅ | ➖ |
Need help choosing? Start with the snippet, then move to the API/SDK once you want full control over UX and reliability.
Join the newsletter to receive occasional updates about new features, launch notes, and practical strategies for converting more leads.
We respect your privacy. Unsubscribe at anytime.