Create a new form endpoint.
| Name | Type | Required | Validation | Description |
|---|---|---|---|---|
name |
string |
Yes | Min 2, max 120 chars | Form display name |
slug |
string |
Yes | Min 2, max 80 chars, regex ^[a-z0-9-]+$ |
URL-safe identifier (lowercase alphanumeric and hyphens only) |
allowedOrigins |
string[] |
No | Default: [] |
List of allowed origin URLs. Empty array allows all origins |
verifyCaptcha |
boolean |
No | Default: false |
Require captcha verification on submissions |
captchaSecret |
string |
No | Required if verifyCaptcha is true |
Captcha provider secret key |
| Error | Cause |
|---|---|
captchaSecret is required when verifyCaptcha is true |
verifyCaptcha set to true without providing captchaSecret |
401 Unauthorized |
Invalid or expired secret key |
| Zod validation error | name too short/long, slug contains invalid characters, etc. |
"Create a contact form with slug 'contact' that only accepts submissions from https://acme.com."
The slug must be lowercase and can only contain letters, numbers, and hyphens. Uppercase letters and special characters will be rejected.
CLI equivalent: npx formdata-dev forms create (interactive prompts for the same fields).