Integrate Leads Ward

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.


Snippet (low-code)

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.

When to use

How to install

  1. Create an API key in the dashboard: Dashboard → API Keys
  2. Copy your snippet: Dashboard → Snippet
  3. Paste before </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.

Limitations


API (developers / power users)

Use the JSON API from SPAs, Next.js/Remix, or your backend. Full control over UX, idempotency, and error handling.

When to use

Endpoint

POST https://www.leadsward.com/api/score
Authorization: Bearer <your_api_key>
Content-Type: application/json

Request body

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."
}

Response (200)

{
  "score": 72,
  "threshold": 40,
  "decision": {
    "conclusion": "ALLOW",
    "reason": "LEGITIMATE_TRAFFIC",
    "details": ["Valid email", "Good message length"]
  }
}

cURL example

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."}'

Get an API key

Create and manage keys in the dashboard: Dashboard → API Keys


Which should I use?

Use caseSnippetAPI
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.

Get product updates and growth tips

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.