Form builder
Forms are embeddable HTML signup forms. Drop the snippet on any page; submissions are stored and can be wired straight into a broadcast list. Optional Turnstile or hCaptcha protects the public endpoint.
- Read
- 4 min
- Sections
- 4
- Limits
- Free 1 · Pro 10 · Business ∞
Create a form
Define fields as JSON. Each field has a name, type(email, text, …), label, and required flag. Set targetBroadcastListId to auto-enroll submitters as contacts.
POST /api/v1/forms
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "Newsletter Signup",
"fieldsJson": "[{\"name\":\"email\",\"type\":\"email\",\"required\":true,\"label\":\"Email address\"}]",
"captchaProvider": "turnstile",
"captchaSiteKey": "0x4AAAAAAA...",
"captchaSecretKey": "0x4AAAAAAA...",
"targetBroadcastListId": "broadcast-list-uuid",
"successRedirectUrl": "https://example.com/thank-you"
}Embed in any page
Fetch the snippet from GET /api/v1/forms/{id}/embed and paste it into your HTML. The script renders the fields, validates required inputs, calls the public submit endpoint, and either redirects to successRedirectUrl or shows an inline success message.
<div id="dr-form-{id}"></div>
<script src="https://your-datarunner.com/embed/form.js"
data-form-id="{id}"
data-base-url="https://your-datarunner.com"></script>Public submit
The public endpoint is rate limited to 10 requests/min per IP. When a captcha provider is set, captchaToken is required and verified server-side before the submission is saved.
POST /api/v1/public/forms/{id}/submit
Content-Type: application/json
{
"data": {
"email": "user@example.com",
"name": "Alice"
},
"captchaToken": "cf-turnstile-response-token"
}Captcha
- Turnstile — Cloudflare. Site key embeds in the snippet; secret key is stored encrypted and verified against Cloudflare.
- hCaptcha — same fields, verified against hCaptcha.
- none — no challenge (use only for trusted internal pages).
targetBroadcastListId is set, each submission upserts a BroadcastListMember by email — so a form can feed directly into a welcome sequence.