POST /v1/f/:publicKey accepts form submissions and queues them for async delivery to all configured destinations.
formdata.dev never persists submission data. The payload is held in memory only long enough to enqueue delivery messages, then discarded.
| Property | Value |
|---|---|
| Method | POST |
| URL | https://api.formdata.dev/v1/f/:publicKey |
| Content-Type | application/json |
| Max payload | 128 KB |
| Header | Required | Description |
|---|---|---|
Content-Type |
Yes | Must be application/json |
Origin |
Conditional | Required if the form has allowedOrigins configured |
x-captcha-token |
Conditional | Required if the form has verifyCaptcha enabled |
Any valid JSON object. The entire body becomes payload in the SubmissionEnvelope delivered to your destinations.
The ingestion endpoint handles CORS automatically:
OPTIONS /v1/f/:publicKey returns appropriate headersPOST onlyContent-Type, x-captcha-tokenIf allowedOrigins is empty (the default), Access-Control-Allow-Origin is set to *. If allowedOrigins contains specific URLs, the Origin header must match one of them.
When a form has verifyCaptcha: true, every submission must include a valid captcha token in the x-captcha-token header. The token is verified server-side against the form's stored captchaSecret using the configured CAPTCHA_VERIFY_URL.
formdata.dev works with Cloudflare Turnstile out of the box. Set captchaSecret to your Turnstile site secret when creating the form.
202 Accepted — Submission queued successfully:
| Status | Error | Cause |
|---|---|---|
400 |
Invalid JSON payload |
Body is not valid JSON |
400 |
Captcha token is required |
verifyCaptcha is enabled but x-captcha-token header is missing |
400 |
Invalid captcha token |
Token failed server-side verification |
403 |
Origin is not allowed for this form |
Origin header does not match allowedOrigins |
404 |
Form endpoint not found or disabled |
Invalid public key or form is disabled |
413 |
Payload too large (max 128KB) |
Content-Length exceeds 128 KB |
Every destination receives a SubmissionEnvelope containing the original payload plus metadata:
| Field | Type | Description |
|---|---|---|
submissionId |
string |
Unique UUID for this submission |
formId |
string |
Internal form identifier |
formName |
string |
Human-readable form name |
payload |
unknown |
The raw JSON body from the submission |
metadata.origin |
string | null |
Origin header value |
metadata.ip |
string | null |
Submitter IP from CF-Connecting-IP |
metadata.userAgent |
string | null |
User-Agent header |
metadata.referer |
string | null |
Referer header |
metadata.submittedAt |
string |
ISO 8601 timestamp |
Response (202):