canonical: https://jentic.com/apis/cloudflare.com/cloudflare

# Cloudflare Turnstile Siteverify API

Validate Turnstile challenge tokens server-side to verify that visitors are genuine humans without presenting visual CAPTCHAs. The single siteverify endpoint accepts a token from the client-side widget along with your secret key and returns a pass/fail verdict with challenge metadata.

## For AI agents

Verify Cloudflare Turnstile tokens server-side to confirm visitors passed the invisible challenge. Returns pass/fail status with error codes for bot detection without visual CAPTCHAs.

## Scope

Does not handle DNS management, CDN configuration, WAF rules, or Workers deployment - use for Turnstile challenge token verification only.

## Capabilities

- Validate Turnstile challenge tokens to confirm a visitor completed the invisible verification widget
- Detect automated traffic by checking token validity, expiration, and replay attempts
- Retrieve challenge metadata including hostname, timestamp, and action tags from verified tokens
- Differentiate between managed, non-interactive, and invisible challenge modes via response fields
- Identify specific failure reasons through structured error codes when token validation fails

## Use cases

### AI Agent Bot Detection Verification

AI agents use the Turnstile Siteverify API through Jentic to validate challenge tokens before processing form submissions or API requests. An agent receives a Turnstile token from a client-side widget, sends it to the siteverify endpoint with the site secret key, and checks the success field. This prevents automated abuse while maintaining a frictionless user experience without visual puzzles.

Example prompt: Send a POST request to /siteverify with the Turnstile response token and secret key, then check if the success field is true and the hostname matches the expected domain

### Form Submission Protection

Protect web forms against automated submissions by requiring Turnstile token validation before processing user input. The siteverify endpoint confirms that the token was generated by a genuine browser interaction on the correct hostname. Failed verifications return error codes identifying whether the token was missing, expired, already redeemed, or associated with a different site.

Example prompt: Validate a Turnstile token from a contact form submission, verify the hostname matches 'example.com', and return the error codes if validation fails

### Token Replay Prevention

Prevent replay attacks by verifying that each Turnstile token is only used once. The siteverify endpoint tracks previously validated tokens and rejects duplicate submissions with a specific error code. This ensures that captured tokens cannot be reused by attackers to bypass bot detection, providing defense-in-depth for sensitive operations like account creation and payment processing.

Example prompt: Submit the same Turnstile token twice to /siteverify and verify that the second request returns success: false with a timeout-or-duplicate error code

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /siteverify | Validate a Turnstile challenge response token |

## Key resources

- **Siteverify** — Token validation endpoint returning pass/fail verdict with challenge metadata and error codes

## Why Jentic

- **Setup:** Wiring the Cloudflare Turnstile Siteverify API by hand means passing your site secret as a query field alongside the response token and posting to challenges.cloudflare.com/turnstile/v0 yourself. Through Jentic you install once, import the Turnstile Siteverify API from the API Directory, store the secret once, and your agent calls it.
- **Permission scoping:** Turnstile exposes a single siteverify operation with the token in the request, so scope the agent to that one operation: it can verify a challenge token and nothing more. You choose that set, so no other call is in reach unless you add it.
- **Credential handling:** Your Turnstile secret key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'verify a bot detection token', and Jentic returns the Turnstile siteverify operation with its request schema, including the secret and response token fields, so the agent calls it without browsing the reference docs.

## Related APIs

- **Google reCAPTCHA Enterprise** — reCAPTCHA Enterprise offers risk scoring while Turnstile provides binary pass/fail without visual challenges
- **Netlify API** — Netlify deploys the frontend that embeds the Turnstile widget while siteverify validates tokens server-side
- **DigitalOcean API** — DigitalOcean hosts the backend server that calls siteverify to validate Turnstile tokens

## FAQ

### What response fields does the Turnstile siteverify endpoint return?

The response includes: success (boolean pass/fail verdict), challenge_ts (ISO timestamp of when the challenge was solved), hostname (the domain where the widget was rendered), error-codes (array of error identifiers if validation failed), and action (the action name if configured in the widget). These fields enable both validation and audit logging.

### What authentication does the Cloudflare Turnstile Siteverify API use?

The siteverify endpoint requires your Turnstile site secret key passed as the 'secret' parameter in the POST body. This is a per-site key generated in the Cloudflare dashboard, separate from your global API key. Through Jentic, the secret key is stored encrypted in your Jentic One instance so agents never handle it directly.

### Can I verify a Turnstile token through the API without the client-side widget?

No. The siteverify endpoint validates tokens that are generated by the Turnstile client-side widget embedded in your HTML page. The widget runs a challenge in the visitor's browser and produces a token. Your server then sends this token to /siteverify for validation. Without a client-side token, there is nothing to verify.

### What error codes does the Turnstile siteverify endpoint return?

Common error codes include: missing-input-secret (secret key not provided), invalid-input-secret (secret key is wrong), missing-input-response (token not provided), invalid-input-response (token is malformed), timeout-or-duplicate (token has expired or was already used), and internal-error (Cloudflare service issue). The error-codes array in the response lists all applicable errors.

### How do I validate a Turnstile token through Jentic?

Search Jentic for 'verify a Turnstile token'. The agent receives the POST /siteverify schema requiring the secret key and response token fields. Send the token received from your frontend form, and check the success boolean in the response. The hostname and challenge_ts fields confirm where and when the challenge was completed.

### Does the Turnstile siteverify endpoint have rate limits?

Cloudflare does not publish explicit rate limits for the siteverify endpoint, but it is designed for per-form-submission validation rather than bulk querying. Each token can only be verified once - subsequent attempts for the same token return a timeout-or-duplicate error. For high-traffic sites, validate only on form submissions, not on page loads.

### Can I limit what my agent is allowed to do with the Cloudflare Turnstile Siteverify API?

Yes. Because Jentic One is self-hosted, your own rules decide which operations and credentials the agent may use. Turnstile exposes only the single POST /siteverify operation, so you scope the agent to that one call: it can validate a challenge response token and read back the success verdict, hostname, timestamp, and error codes, and nothing more. Your Turnstile site secret is injected at execution time from your own instance, so the agent verifies tokens without ever handling the key, and no other action is reachable unless you grant it.
