Submission API
The public submission endpoint accepts HTTP POST requests from websites, SPAs, and backend services:
{environment}issandboxorproduction.{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 thatOriginmatches the form's published Allowed origins. Inproduction, onlyhttps://origins are allowed (403origin_not_allowedotherwise). Never send a project API key from browser code. - Server-to-server requests (without
Origin): IncludeAuthorization: Bearer <API_KEY>using a project key that matches the target environment (fr_sandbox_...forsandbox,fr_production_...forproduction). Missing or mismatched keys return401(server_authentication_required).
Content types
application/json: Preferred forfetch, 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
Reserved control fields are stripped from stored lead fields before strict JSON Schema validation and storage.
Responses
201 Created(application/json): Returns anAcceptedSubmissionreceipt (receiptId,acceptedAt,environment,requestId,replay) forfetch/ API callers.303 See Other(HTML<form>posts): Redirects visitors to your configured Success redirect (or Error redirect on failure) whenAcceptprefers 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.