Skip to main content

Form Submission API

Endpoint and request formats​

POST to /api/submit with access_key in the request body, or POST to /api/submit/{key}. Send JSON, URL-encoded form data, or multipart form data. Multipart is required for files. A custom Content-Type header is unnecessary when Fetch sends a FormData body.

Older HTML forms can use the hidden apikey field with a Forms4Web public access key. Forms4Web uses the URL key first, then access_key, then apikey. It excludes apikey and recaptcha_response from stored fields and deliveries. The paid features guide describes both reCAPTCHA v3 token formats.

curl 'https://api.bitebrake.com/api/submit' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data '{"access_key":"YOUR_FORM_KEY","email":"sample@example.com","message":"Example message"}'

Success and errors​

An accepted JSON request returns a success flag, message, and submission ID. Flagged spam can receive a success response with a null ID. An accepted native form navigation requesting HTML returns a 303 redirect. It uses an eligible submitted redirect, then the form’s configured success URL, then the built-in confirmation page at /api/submit/success. Refreshing the built-in confirmation page makes a read-only GET request. JSON failures expose an error field.

{
"success": true,
"message": "Your message was received.",
"submissionId": "submission-id"
}

Retry without duplicating a submission​

When submitting with Fetch or another HTTP client, send an Idempotency-Key header on the public endpoint. Generate one key per intended submission and reuse it if you retry the same request after a timeout. Keys can contain 1–128 letters, digits, periods, underscores, tildes, or hyphens.

A completed request can be replayed for up to 24 hours, subject to retention. The same key and submission content return the previous result without creating a new inbox entry or sending another notification. A replay can return a null submission ID if the original entry was flagged as spam or has since been removed.

If the first request is still running, the response is 409 with a Retry-After header. Wait that many seconds before retrying with the same key. Reusing a key for different fields, attachments, or Reply-To also returns 409. Use a new key for a new submission.

Status codes​

Use the HTTP status together with the response body to decide what to show. Preserve the visitor’s input when a request fails.

StatusCommon cause
200 / 303Accepted JSON response, or redirected after an accepted native form post.
400Missing key, missing fields, invalid values, or an incomplete CAPTCHA.
403The source hostname is outside the allowed domain list.
404The form key is unknown or the form is paused.
409Form settings changed, a retry is still in progress, or the same idempotency key was used for different submission content.
413The request exceeds a text or attachment limit.
429The workspace quota or a request rate limit has been reached.
503Upload processing or CAPTCHA verification is temporarily unavailable.

Request and origin constraints​

The service accepts up to 100 text field names and 25 values per name. Individual values can be up to 20,000 characters, with a combined limit of 128,000 bytes for stored text fields. If a form has an allowlist, make the request from a listed site with a usable Origin or Referer header.