For AI agents: the complete documentation index is available at /docs/llms.txt, the full documentation bundle is available at /docs/llms-full.txt, and this page is available as Markdown at /docs/api/submissions.md.

Submission API

The public submission endpoint accepts HTTP POST requests from websites, SPAs, and backend services:

POST https://formroost.com/s/v1/{environment}/{submissionId}
  • {environment} is sandbox or production.
  • {submissionId} is your form's public ID (fpub_...), visible in your Form settings in the portal.

Request authentication

FormRoost automatically applies the right trust check based on whether a browser Origin header is present:

  • Browser requests (with Origin): FormRoost validates that Origin matches the form's published Allowed origins. In production, only https:// origins are allowed (403 origin_not_allowed otherwise). Never send a project API key from browser code.
  • Server-to-server requests (without Origin): Include Authorization: Bearer <API_KEY> using a project key that matches the target environment (fr_sandbox_... for sandbox, fr_production_... for production). Missing or mismatched keys return 401 (server_authentication_required).

Content types

  • application/json: Preferred for fetch, React, Next.js, and server requests. Nested JSON objects and arrays are preserved.
  • application/x-www-form-urlencoded: Standard HTML <form method="post"> submissions. Supports bracket/dot fields and repeated checkbox inputs.

Reserved request headers and control fields

ControlLocationPurpose
Idempotency-KeyHTTP headerDeduplicates identical retried submissions (8–200 chars). Sets "replay": true on subsequent matching retries; different payloads with the same key return 409 (idempotency_conflict).
_fr_idempotency_keyForm fieldOptional form-field alternative to the Idempotency-Key header for HTML posts.
_fr_started_atForm fieldTimestamp (Date.now() ms, numeric string, or ISO-8601) checked against your form's minimum fill-time setting.
cf-turnstile-responseForm fieldCloudflare Turnstile token required when Turnstile is enabled on the form.

Reserved control fields are stripped from stored lead fields before strict JSON Schema validation and storage.

Responses

  • 201 Created (application/json): Returns an AcceptedSubmission receipt (receiptId, acceptedAt, environment, requestId, replay) for fetch / API callers.
  • 303 See Other (HTML <form> posts): Redirects visitors to your configured Success redirect (or Error redirect on failure) when Accept prefers HTML over JSON and a redirect URL is configured; otherwise returns a clean FormRoost confirmation or error page.
  • 4xx / 5xx (application/problem+json): Machine-readable RFC 9457 Problem Details pointing to the exact error code under Error responses.

See the Submission OpenAPI specification for the formal machine-readable schema.