Lead forms

Your form keeps its design and its fields. The connection is one change: where the form posts.

The complete example

HTML + JavaScript
<form id="lead-form">
  <input name="name" required placeholder="Your name">
  <input name="email" type="email" placeholder="Email">
  <input name="phone" type="tel" placeholder="Phone">
  <textarea name="message" required placeholder="How can we help?"></textarea>
  <button type="submit">Send</button>
</form>
<script>
  document.getElementById("lead-form").addEventListener("submit", async (e) => {
    e.preventDefault();
    const data = Object.fromEntries(new FormData(e.target));
    data.client = "YOUR_CLIENT_ID";
    const res = await fetch("https://forms.secondshift.site/api/submit", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify(data),
    });
    if (res.ok) location.href = "/thanks"; // your own thank-you page
  });
</script>

This is the whole connection: your form posts to the Second Shift endpoint with your client ID in the client field. name and message are required; email, phone, and any other named fields you add are saved on the lead. If your form setup cannot add the client field, post to https://forms.secondshift.site/api/f/YOUR_CLIENT_ID instead: the ID travels in the URL. Both endpoints answer with a JSON confirmation.

Fields

name and message are required. email, phone, and any other named fields you add are saved on the lead and shown in your dashboard. A lead sent twice merges into the existing one instead of creating a duplicate, and the response says so; see Send a lead in the API reference.

The hosted endpoint

If your form setup cannot add the client field, post to https://forms.secondshift.site/api/f/YOUR_CLIENT_ID instead: the ID travels in the URL. Named forms are supported as /api/f/YOUR_CLIENT_ID/FORM_NAME. Both endpoints answer with a JSON confirmation.

Optional: captcha spam protection

HTML, optional add-on
<!-- Optional: spam protection for a form that already posts to Second Shift -->
<script src="https://forms.secondshift.site/api/snippet?client=YOUR_CLIENT_ID" async></script>

Captcha only. This script adds Cloudflare Turnstile spam protection to a form that already posts to Second Shift. It does not connect the form by itself: without the endpoint change above it changes nothing. If captcha is off in your dashboard settings, it loads and stays invisible. Only add it if you want the protection.

Rather not touch form code?

The dashboard also offers a drop-in form and a one-line embed under Settings, Developer tools. They post to the same endpoint and land in the same dashboard; use whichever route is less work on your site.