Skip to main content
If you have not created a form before, start with Create a form.
form.yaml
version: 1
title: "Contact us"
description: "Send us a message. Turnstile protects this form from bots."

sections:
  - id: section_1
    title: "Your message"
    fields:
      - id: name
        type: short_text
        label: "Name"
        placeholder: "Jane Smith"
        validators:
          - required

      - id: email
        type: email
        label: "Email address"
        placeholder: "jane@example.com"
        validators:
          - required

      - id: message
        type: long_text
        label: "Message"
        placeholder: "How can we help?"
        validators:
          - required

      # Place the Turnstile challenge at the end of the section.
      # It runs automatically — no action is required from the user.
      - id: captcha
        type: turnstile
        label: "Verify you are human"

    next: done

connections:
  - type: email
    to: "support@example.com"
    subject: "New message from {{data.name}}"
    include_responses: true
Add a turnstile field to any section to require a Cloudflare Turnstile challenge before the section can be submitted. The challenge is non-interactive — most users will pass it automatically without clicking anything. Place the Turnstile field as the last field in the section so it runs after the user has filled in their answers. The field is automatically required — you do not need to add a required validator.