Skip to the documentation
CLI

Sign-up forms

Every command for sign-up forms and the people who fill them in, with worked examples.

How it fits together

A sign-up form adds the people who fill it in to your audiences. It keeps a draft and a live copy: update changes the draft and the settings, and publish puts the draft live. Reading needs forms:read and changing needs forms:write. resend-confirmation, and any change that makes the form send mail, also needs emails:send.

Terminal
nextmail forms create --name "Newsletter sign-up" --starter newsletter --publishnextmail forms list-submissions frm_3b9d2e7a1c4f80d56e2a9b14 --status pendingnextmail forms analytics frm_3b9d2e7a1c4f80d56e2a9b14 --days 30

Forms

CommandWhat it does
nextmail forms listOne page of the forms, newest first, with their status and numbers
nextmail forms create --name <value>Make a draft from --starter, a --document file or one email field. --publish puts it live at once
nextmail forms get <id>One form with its draft, its live copy and its settings
nextmail forms update <id>Change the name, the --document draft or any settings, such as --settings-double-opt-in, in one call
nextmail forms publish <id>Put the draft live
nextmail forms pause <id>Stop a published form taking sign-ups
nextmail forms resume <id>Open a paused form again
nextmail forms duplicate <id>Copy a form into a new draft, without its sign-ups
nextmail forms design --brief <value>Design a new draft form from a written brief, as Create with AI does in the app. It spends one AI action
nextmail forms redesign <id> --instructions <value>Change the draft of a form from written instructions, as Ask AI does in the form builder. It spends one AI action
nextmail forms delete <id>Delete a form and its sign-ups after you confirm. A browser sign-in also asks for a verification code
nextmail forms list-startersThe starting points a new form can begin from
nextmail forms get-starter <slug>One starting point with its document
nextmail forms analytics <id>Views, sign-ups and people added over a window, 30 days unless --days or --minutes says otherwise

Submissions

CommandWhat it does
nextmail forms list-submissions <id>One page of sign-ups, newest first. --q searches email addresses and --status picks pending or added
nextmail forms get-submission <id> <submission-id>One sign-up with every answer
nextmail forms delete-submission <id> <submission-id>Delete one sign-up after you confirm. The person stays in your contacts
nextmail forms delete-submissions <id> <submission-ids...>Delete up to 200 sign-ups after you confirm
nextmail forms approve-submission <id> <submission-id>Add a waiting sign-up without its confirmation. Needs contacts:write too
nextmail forms resend-confirmation <id> <submission-id>Email a waiting sign-up a fresh confirmation link, unless one went out in the last ten minutes. Needs emails:send too

Signing someone up

subscribe posts to a published form as its page does. It needs no key and no sign-in, so it works signed out. Pass the other answers as JSON with --data, and the page the form was on with --oe-source.

Terminal
nextmail forms subscribe frm_3b9d2e7a1c4f80d56e2a9b14 --email ann@example.com --data '{"first_name":"Ann","consent":true}'

A missing or wrong answer exits with code 7 and lists each field and its reason. A paused form exits with 6, and too many sign-ups from one network with 8.