Quickstart
A form that emails you every response, from an empty terminal. The commands use curl and node; the CLI does the same in fewer keystrokes.
1. Get a token
Sign in from your terminal. It prints a code; approve it at formto.io/connect in the browser where you are signed in.
npx -y https://formto.io/dl/cli-latest.tgz loginThe token is saved to ~/.formto/credentials.json. For scripts, create one under API keys instead and export it as FORMTO_TOKEN. Never paste a token into a chat.
2. Create a form
curl -fsS https://api.formto.io/v2/forms \
-H "Authorization: Bearer $FORMTO_TOKEN" \
-H 'content-type: application/json' \
-d '{"name":"Contact"}' > form.json
node -e 'const f = require("./form.json"); console.log("Form " + f.id + " posts to https://api.formto.io/f/" + f.publicId)'Responses are emailed to the workspace owner. The form starts with no field rules, so it accepts whatever your page sends.
3. Add it to your page
Paste this into your HTML and replace YOUR_FORM_ID with the publicId from step 2. The hidden _gotcha field catches bots; keep it.
<form action="https://api.formto.io/f/YOUR_FORM_ID" method="post">
<label for="name">Name</label>
<input id="name" name="name" required>
<label for="email">Email</label>
<input id="email" name="email" type="email" required>
<label for="message">Message</label>
<textarea id="message" name="message" required></textarea>
<input type="text" name="_gotcha" tabindex="-1" autocomplete="off" aria-hidden="true" style="position:absolute;left:-10000px">
<button type="submit">Send</button>
</form>4. Send a test response
curl -fsS "https://api.formto.io/f/$(node -p 'require("./form.json").publicId')" \
-H 'accept: application/json' \
-d name=Ada -d email=ada@example.com -d message='Hello from the quickstart'The answer is {"success":true,...}, and the owner gets an email.
5. Read your responses
curl -fsS "https://api.formto.io/v2/submissions?formId=$(node -p 'require("./form.json").id')" \
-H "Authorization: Bearer $FORMTO_TOKEN"They are also in the dashboard under Responses. Next: restyle the form or send responses to Slack or a webhook.