{"openapi":"3.1.1","info":{"title":"Static Forms Public Submission API","version":"1.0.0","description":"Submit form data using a form API key in the request body. This specification covers the public submission API, not authenticated workspace management or MCP. Submissions can send email and trigger integrations. Spam filtering can return a success response without delivery."},"servers":[{"url":"https://api.staticforms.dev"}],"externalDocs":{"url":"https://www.staticforms.dev/docs/api-reference"},"paths":{"/submit":{"post":{"operationId":"submitForm","summary":"Submit a form","description":"Include apiKey (or its accessKey alias) in the body. Arbitrary named form fields are supported. CAPTCHA and required fields depend on the form configuration. Send Accept: application/json for programmatic requests. URL-encoded requests accepting text/html receive plain text. A valid redirectTo can produce a 303 redirect. A native browser form post (url-encoded or multipart, Accept: text/html, not reported as fetch, XHR or an iframe) with no valid redirectTo uses the URL saved on the form's General tab, if any. Submission keys do not grant read or management access.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","anyOf":[{"required":["apiKey"]},{"required":["accessKey"]}],"properties":{"apiKey":{"type":"string","minLength":1,"description":"The form submission API key. Required unless accessKey is supplied."},"accessKey":{"type":"string","minLength":1,"description":"Accepted alias for apiKey."},"email":{"type":"string","description":"Submitter email; used for replies when valid."},"replyTo":{"type":"string","description":"Optional reply address; a valid value takes precedence over email."},"redirectTo":{"type":"string","format":"uri","description":"Optional HTTP(S) destination after submission. Form Rules may override it. It overrides a URL saved on the form's General tab."},"honeypot":{"type":"string","description":"Leave empty. Custom honeypot field names depend on the form configuration."},"recaptchaToken":{"type":"string","description":"reCAPTCHA response token when the form requires it."},"g-recaptcha-response":{"type":"string","description":"reCAPTCHA widget response."},"altchaToken":{"type":"string","description":"ALTCHA solution when the form requires it."},"altcha":{"type":"string","description":"ALTCHA widget solution."},"cf-turnstile-response":{"type":"string","description":"Cloudflare Turnstile response token."},"h-captcha-response":{"type":"string","description":"hCaptcha response token."}},"additionalProperties":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Other form fields. In a form-encoded or multipart body, a repeated name combines into an array; in a JSON body, the last duplicate key wins. A field named __proto__ is stored as proto_field, and one with an empty name as unnamed_field. In the stored submission, a name over 63,000 bytes is cut to that length and an unpaired surrogate in a name becomes U+FFFD."}}},"application/x-www-form-urlencoded":{"schema":{"type":"object","anyOf":[{"required":["apiKey"]},{"required":["accessKey"]}],"properties":{"apiKey":{"type":"string","minLength":1,"description":"The form submission API key. Required unless accessKey is supplied."},"accessKey":{"type":"string","minLength":1,"description":"Accepted alias for apiKey."},"email":{"type":"string","description":"Submitter email; used for replies when valid."},"replyTo":{"type":"string","description":"Optional reply address; a valid value takes precedence over email."},"redirectTo":{"type":"string","format":"uri","description":"Optional HTTP(S) destination after submission. Form Rules may override it. It overrides a URL saved on the form's General tab."},"honeypot":{"type":"string","description":"Leave empty. Custom honeypot field names depend on the form configuration."},"recaptchaToken":{"type":"string","description":"reCAPTCHA response token when the form requires it."},"g-recaptcha-response":{"type":"string","description":"reCAPTCHA widget response."},"altchaToken":{"type":"string","description":"ALTCHA solution when the form requires it."},"altcha":{"type":"string","description":"ALTCHA widget solution."},"cf-turnstile-response":{"type":"string","description":"Cloudflare Turnstile response token."},"h-captcha-response":{"type":"string","description":"hCaptcha response token."}},"additionalProperties":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"Other form fields. In a form-encoded or multipart body, a repeated name combines into an array; in a JSON body, the last duplicate key wins. A field named __proto__ is stored as proto_field, and one with an empty name as unnamed_field. In the stored submission, a name over 63,000 bytes is cut to that length and an unpaired surrogate in a name becomes U+FFFD."}}},"multipart/form-data":{"schema":{"type":"object","anyOf":[{"required":["apiKey"]},{"required":["accessKey"]}],"properties":{"apiKey":{"type":"string","minLength":1,"description":"The form submission API key. Required unless accessKey is supplied."},"accessKey":{"type":"string","minLength":1,"description":"Accepted alias for apiKey."},"email":{"type":"string","description":"Submitter email; used for replies when valid."},"replyTo":{"type":"string","description":"Optional reply address; a valid value takes precedence over email."},"redirectTo":{"type":"string","format":"uri","description":"Optional HTTP(S) destination after submission. Form Rules may override it. It overrides a URL saved on the form's General tab."},"honeypot":{"type":"string","description":"Leave empty. Custom honeypot field names depend on the form configuration."},"recaptchaToken":{"type":"string","description":"reCAPTCHA response token when the form requires it."},"g-recaptcha-response":{"type":"string","description":"reCAPTCHA widget response."},"altchaToken":{"type":"string","description":"ALTCHA solution when the form requires it."},"altcha":{"type":"string","description":"ALTCHA widget solution."},"cf-turnstile-response":{"type":"string","description":"Cloudflare Turnstile response token."},"h-captcha-response":{"type":"string","description":"hCaptcha response token."},"file":{"type":"string","format":"binary","description":"Example file field name; use your own."}},"additionalProperties":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"description":"File fields use your own names, and a name can repeat for several files. File uploads require an eligible plan. The whole request body, all files plus the other fields, must stay under 4.5 MB; larger requests receive 413. A field named __proto__ is stored as proto_field, and one with an empty name as unnamed_field. In the stored submission, a name over 63,000 bytes is cut to that length and an unpaired surrogate in a name becomes U+FFFD. See the file upload guide."}}}},"responses":{"200":{"description":"Submission accepted. Acceptance does not guarantee email delivery or storage.","content":{"application/json":{"schema":{"type":"object","required":["success","message"],"properties":{"success":{"const":true},"message":{"type":"string"},"id":{"type":"string","description":"Present only when a stored submission ID is available."}}}},"text/plain":{"schema":{"type":"string"}}}},"303":{"description":"Redirect to the valid rule-configured or submitted destination, or for a native browser form post the URL saved on the form's General tab.","headers":{"Location":{"schema":{"type":"string","format":"uri"}}}},"400":{"description":"Missing API key, malformed request, CAPTCHA failure, or invalid form data.","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","required":["field","message"],"properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}},"text/plain":{"schema":{"type":"string"}}}},"401":{"description":"Invalid submission API key.","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","required":["field","message"],"properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}},"text/plain":{"schema":{"type":"string"}}}},"403":{"description":"Submission not permitted for this form or account.","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","required":["field","message"],"properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}},"text/plain":{"schema":{"type":"string"}}}},"413":{"description":"Request body over 4.5 MB, refused by the hosting platform before processing: nothing is stored and no email is sent. The body depends on Accept, and the response has no CORS headers, so browser fetch() calls see a network error instead of this status.","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}},"text/plain":{"schema":{"type":"string"}},"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Form builder field validation failed. JSON responses contain field errors.","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","required":["field","message"],"properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}},"text/plain":{"schema":{"type":"string"}}}},"429":{"description":"Rate or submission limits exceeded.","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","required":["field","message"],"properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}},"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Submission processing failed.","content":{"application/json":{"schema":{"type":"object","required":["success"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"errors":{"type":"array","items":{"type":"object","required":["field","message"],"properties":{"field":{"type":"string"},"message":{"type":"string"}}}}}}},"text/plain":{"schema":{"type":"string"}}}}}}}}}