Server-side submissions
Send submissions from your backend (for example from a mobile app's server, a cron job or a webhook). Add your project's secret key as a Bearer token. It replaces the browser origin check, and the Turnstile challenge is skipped. Find the key on the project's page; it is shown once when created, so store it as an environment variable.
Keep the secret key on the server. Anyone who has it can submit to every form in the project. If it leaks, regenerate it from the project's page.
cURL
terminal
# Server-to-server: authenticate with your project's secret key instead of a browser origin.
# Keep the secret key on your server — never put it in browser code.
curl -X POST "https://api.formtura.app/v1/submit/YOUR_FORM_ID" \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{"name":"Ada","email":"ada@example.com","message":"Hello!"}'Node.js
server.mjs
// Node 18+ (no dependencies)
const res = await fetch("https://api.formtura.app/v1/submit/YOUR_FORM_ID", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.FORMTURA_SECRET_KEY}`,
"Content-Type": "application/json",
Accept: "application/json",
},
body: JSON.stringify({ name: "Ada", email: "ada@example.com", message: "Hello!" }),
});
const data = await res.json();
if (!res.ok) throw new Error(`${data.code}: ${data.error}`);Python
submit.py
import os, requests
res = requests.post(
"https://api.formtura.app/v1/submit/YOUR_FORM_ID",
headers={"Authorization": f"Bearer {os.environ['FORMTURA_SECRET_KEY']}", "Accept": "application/json"},
json={"name": "Ada", "email": "ada@example.com", "message": "Hello!"},
timeout=10,
)
data = res.json()
if not res.ok:
raise RuntimeError(f"{data['code']}: {data['error']}")An invalid key returns 401 invalid_api_key. Submissions sent this way are labelled API (secret key) in the dashboard.