Forms
Create a form
POST/v1/forms
Requires an API key with the forms:write scope. About keys and scopes
Creates a hosted signup form, in draft. Submissions create or update contacts and record consent, so the consent configuration here is what makes later sends lawful.
Request body
namestringrequired1–255 characters
headingstring | nulloptionalWhat visitors see above the fields;
nullclears it.1–200 characters
introstring | nulloptionalA line or two under the heading;
nullclears it.1–1000 characters
sourcestringoptionalRecorded on each contact the form creates. Defaults to
form.1–80 characters · default
"form"groupIdstringrequiredThe group every submitter is added to.
uuid
fieldsFormFieldInput[]requiredThe fields, top to bottom. One must be a required
emailfield.at least 1 item · at most 20 items
6 child attributes
keystringrequiredWhere the answer goes:
email,firstName,lastName,phone,attributes.<name>,dates.<name>(a named date that date-triggered journeys read),groupsortopics. Each type accepts only some keys.up to 80 characters
typestringrequiredThe input the visitor sees.
one of
email,text,textarea,select,checkbox,date,phonelabelstringrequiredThe text shown beside the field.
1–120 characters
placeholderstringoptionalHint text shown inside the empty field.
up to 160 characters
requiredbooleanoptionalWhether the visitor must fill it in.
default
falseoptionsobject[]optionalRequired for
selectandcheckbox, refused for other types. For thegroupskey each value is a group id, fortopicsa topic id; the label is what the visitor sees beside its box.at least 1 item · at most 50 items
2 child attributes
valuestringrequiredWhat is stored when chosen.
1–100 characters
labelstringrequiredWhat the visitor sees.
1–120 characters
hiddenFieldsobjectoptionalFixed values saved on each submitter with no field shown, such as a campaign tag. Each becomes a contact attribute.
default
{}allowedOriginsstring[]optionalSite origins (scheme and host, no path) the embed may load from, such as
https://example.com.at most 20 items · default
[]doubleOptInbooleanoptionalAsk submitters to confirm by email before they are subscribed.
themeFormThemeInputoptional4 child attributes
accentColorstringoptionalColour of the button and focus outlines, as
#RRGGBB.fontFamilystringoptionalThe font style of the form.
one of
system,sans,serif,monoborderRadiusintegeroptionalCorner rounding of inputs and the button, in px.
min 0 · max 24
buttonLabelstringoptionalText on the submit button.
1–40 characters
displayobjectoptionalOne of 2 shapes
- Inline
1 child attribute
mode"inline"required
- Popup
7 child attributes
mode"popup"requireddelaySecondsintegeroptionalSeconds after the page loads before it opens. Defaults to 5.
min 0 · max 600
scrollPercentintegeroptionalOpens once the visitor has scrolled this far down the page.
min 1 · max 100
exitIntentbooleanoptionalOpens when the visitor moves to leave the page (desktop only).
urlMatchobjectoptionalLimits which pages the popup opens on.
2 child attributes
containsstring[]optionalShow only on pages whose URL contains one of these.
at most 20 items
excludesstring[]optionalNever show on pages whose URL contains one of these.
at most 20 items
hideForDaysintegeroptionalDays it stays away once closed. Defaults to 7.
min 0 · max 365
hideAfterSubmitbooleanoptionalWhether it stays away after a signup. Defaults to true.
captchaobject | nulloptionalCAPTCHA for submissions:
{ mode: "kirora" }(the default on a new form),{ mode: "own", siteKey, secretKey }for your Cloudflare Turnstile widget, ornullfor none.One of 2 shapes
- KiroraCaptchaInput
1 child attribute
mode"kirora"required
- OwnCaptchaInput
3 child attributes
mode"own"requiredsiteKeystringrequiredThe widget's public site key.
1–200 characters
secretKeystringoptionalThe widget's secret key. Write-only: omit it to keep the stored one.
1–200 characters
consentobjectrequiredThe consent box every submitter must tick.
2 child attributes
requiredtruerequiredAlways
true: the visitor must tick the consent box.labelstringrequiredThe consent text shown beside the box.
1–500 characters
successobjectoptionalWhat happens after a submission. Defaults to a thank-you message.
default
{"type":"message","message":"Thanks for signing up."}One of 2 shapes
- Show a message
2 child attributes
type"message"requiredmessagestringrequiredShown in place of the form.
1–1000 characters
- Redirect
2 child attributes
type"redirect"requiredredirectUrlstringrequiredAn http(s) address the visitor is sent to.
uri · up to 2048 characters
Returns
Returns 201 Created with a Form in data. Otherwise returns an error; Errors lists every code and which to retry.
idstringrequireduuid
publicIdstringrequiredThe id the public embed and hosted page use.
namestringrequiredheadingstring | nullrequiredWhat visitors see above the fields;
nullshows none.introstring | nullrequiredA line or two under the heading;
nullshows none.sourcestringrequiredRecorded on each contact the form creates.
statusstringrequiredWhether the form accepts submissions.
one of
draft,publishedgroupIdstring | nullrequiredThe group every submitter is added to.
uuid
fieldsobject[]requiredThe fields, top to bottom.
6 child attributes
keystringrequiredWhere the answer goes, such as
emailorattributes.plan.typestringrequiredThe input the visitor sees.
one of
email,text,textarea,select,checkbox,date,phonelabelstringrequiredThe text shown beside the field.
placeholderstringoptionalHint text shown inside the empty field.
requiredbooleanrequiredWhether the visitor must fill it in.
optionsobject[]optionalThe choices of a
selectorcheckboxfield.2 child attributes
valuestringrequiredlabelstringrequired
hiddenFieldsobjectrequiredFixed values saved on each submitter with no field shown.
allowedOriginsstring[]requiredSite origins the embed may load from.
refusedOriginsobject[]requiredOrigins an embed was refused from lately, newest first, not counting any since added to
allowedOrigins; add one there to approve it.2 child attributes
originstringrequiredThe origin that was refused.
lastRefusedAtstringrequiredWhen it was last refused.
date-time
doubleOptInbooleanrequiredWhether submitters must confirm by email before they are subscribed.
themeFormThemerequired4 child attributes
accentColorstringoptionalColour of the button and focus outlines, as
#RRGGBB.fontFamilystringoptionalThe font style of the form.
one of
system,sans,serif,monoborderRadiusintegeroptionalCorner rounding of inputs and the button, in px.
min 0 · max 24
buttonLabelstringoptionalText on the submit button.
1–40 characters
displayobjectrequiredOne of 2 shapes
- Inline
1 child attribute
mode"inline"required
- Popup
7 child attributes
mode"popup"requireddelaySecondsintegeroptionalSeconds after the page loads before it opens. Defaults to 5.
min 0 · max 600
scrollPercentintegeroptionalOpens once the visitor has scrolled this far down the page.
min 1 · max 100
exitIntentbooleanoptionalOpens when the visitor moves to leave the page (desktop only).
urlMatchobjectoptionalLimits which pages the popup opens on.
2 child attributes
containsstring[]optionalShow only on pages whose URL contains one of these.
at most 20 items
excludesstring[]optionalNever show on pages whose URL contains one of these.
at most 20 items
hideForDaysintegeroptionalDays it stays away once closed. Defaults to 7.
min 0 · max 365
hideAfterSubmitbooleanoptionalWhether it stays away after a signup. Defaults to true.
captchaobject | nullrequiredWhere the CAPTCHA comes from;
nullwhile it is off. Secrets never show.One of 2 shapes
- KiroraCaptchaSetting
1 child attribute
mode"kirora"required
- OwnCaptchaSetting
2 child attributes
mode"own"requiredsiteKeystringrequired
consentobjectrequired2 child attributes
requiredtruerequiredAlways
true: the visitor must tick the consent box.labelstringrequiredThe consent text shown beside the box.
successobjectrequiredOne of 2 shapes
- Show a message
2 child attributes
type"message"requiredmessagestringrequiredShown in place of the form.
- Redirect
2 child attributes
type"redirect"requiredredirectUrlstringrequiredAn http(s) address the visitor is sent to.
uri
archivedAtstring | nullrequiredWhen it was archived; an archived form is left out of the list and stops serving.
date-time
createdAtstringrequireddate-time
updatedAtstringrequireddate-time