Add a destination to a form. Destinations define where form submissions are delivered.
| Name | Type | Required | Validation | Description |
|---|---|---|---|---|
formId |
string |
Yes | -- | Form ID (UUID) |
type |
string |
Yes | One of: smtp, webhook, google_sheets_webhook |
Destination type |
config |
object |
Yes | Shape depends on type (see below) |
Destination configuration |
isEnabled |
boolean |
No | Default: true |
Enable this destination |
webhook| Field | Type | Required | Description |
|---|---|---|---|
url |
string |
Yes | Full URL to receive submissions |
method |
string |
Yes | HTTP method (typically POST) |
headers |
object |
No | Custom HTTP headers as key-value pairs |
smtp| Field | Type | Required | Description |
|---|---|---|---|
host |
string |
Yes | SMTP server hostname |
port |
number |
Yes | SMTP port (typically 587) |
secureTransport |
string |
Yes | starttls, on, or off |
username |
string |
Yes | SMTP auth username |
password |
string |
Yes | SMTP auth password |
from |
string |
Yes | Sender email address |
to |
string[] |
Yes | Recipient email addresses |
subjectTemplate |
string |
Yes | Email subject with {{formName}} variable |
google_sheets_webhook| Field | Type | Required | Description |
|---|---|---|---|
url |
string |
Yes | Google Apps Script or webhook URL |
method |
string |
Yes | HTTP method (typically POST) |
authHeader |
string |
No | Authorization header value |
| Error | Cause |
|---|---|
Form not found. |
Invalid form ID or form belongs to a different organization |
401 Unauthorized |
Invalid or expired secret key |
| Zod validation error | Invalid type value or malformed config object |
"Add a webhook destination to my contact form that posts to https://hooks.slack.com/services/T00/B00/xxx."
CLI equivalent: npx formdata-dev destinations add (interactive wizard for config).