Forms
Point a contact, signup or quote form on your site at Snekot. Each submission is kept with the files it came with, tied to the person who wrote it, and worked through in the app.
Point a form on your site here and each submission is kept under Forms in the app: a table with a column for every field, a status to work through (New, Replied, Done) and a note. A submission with an email address in it belongs to that person, so it sits on their timeline beside the pages they read and where they came from.
Nothing is set up first. A form is named by the page that sends it and appears the first time it is sent, and whatever fields arrive are kept.
A plain HTML form
No script is needed. Give the form this address, with a public key and the form’s name in it:
<form action="https://api.snekot.co/v1/form/YOUR_PUBLIC_KEY/Contact" method="post">
<input name="email" type="email" required>
<textarea name="message" required></textarea>
<input name="_trap" tabindex="-1" autocomplete="off" hidden>
<button>Send</button>
</form>
| In the form | |
|---|---|
| The name at the end of the address | Required. The form’s name, up to 64 characters. Contact, contact and CONTACT are the same form; another name is another form. Write a space as %20. |
Any field with a name |
Kept under that name. Boxes ticked under one name are kept as a list. An empty field is left out. |
A file field, <input type="file"> |
The file is kept with the submission. The form needs enctype="multipart/form-data". See Files. |
A field named _trap |
Leave it empty and hidden. People never see it; a script that fills in every field does, and what it sends is answered like any other and not kept. |
A field named _redirect |
Where the visitor goes once the form is sent, such as /thanks. It must be on the form’s own site, or on one of the project’s allowed sites. |
Other fields whose name starts with _ |
Left out, so a page can carry fields of its own. |
Without _redirect the visitor sees a short page that says the message was sent, with a link back. When a submission is refused they see why in words meant for them, never anything about keys or plans.
The form may be sent as application/x-www-form-urlencoded, which is what a browser does, or as multipart/form-data, which a form with a file field must use.
With the browser script
With the browser script on the page, mark the form and the page stays where it is:
<form data-snekot-form="Contact">
<input name="email" type="email" required>
<textarea name="message" required></textarea>
<button>Send</button>
<p data-snekot-success hidden>Thanks, we will be in touch.</p>
<p data-snekot-error hidden>That did not work. Try again.</p>
</form>
| In the form | |
|---|---|
data-snekot-form |
Required, on the <form>. Its value is the form’s name. |
An element with data-snekot-success |
Shown once the submission is in. Start it hidden. |
An element with data-snekot-error |
Shown when it was refused or the server could not be reached. Start it hidden. |
A field named _redirect |
The page to open once the submission is in. |
The form carries data-snekot-state, which is sending, done or error, for styling, and fires snekot:form-sent or snekot:form-failed. After a submission the form is cleared. Password and card fields are never sent. The script also says what each field is, so a <select> is a choice from the first submission. A file someone chose in a file field goes along, with nothing more to write.
With a form of your own, call the script instead. The promise is true once the submission is in:
const ok = await snekot.form('Contact', { email: '[email protected]', message: 'Hello' });
To send files with it, pass them as pairs of field name and File:
const ok = await snekot.form('Apply', { email: '[email protected]' }, { files: [['cv', input.files[0]]] });
Files
A form may take files: a CV on an application, a brief on a quote request, a photo on a claim. Add a file field and say how the form is sent:
<form action="https://api.snekot.co/v1/form/YOUR_PUBLIC_KEY/Apply" method="post" enctype="multipart/form-data">
<input name="email" type="email" required>
<input name="cv" type="file" accept=".pdf,.doc,.docx">
<button>Send</button>
</form>
With the browser script, a <form data-snekot-form> with a file field needs nothing else.
| One file | Up to 10 MB. |
| Files in one submission | Up to 5, and 25 MB for the form in all. |
| Kinds that are taken | Documents and pictures: pdf, doc, docx, xls, xlsx, ppt, pptx, odt, ods, odp, rtf, txt, csv, png, jpg, jpeg, gif, webp, heic, heif. A file must be what its name says it is. Programs, archives, web pages and SVG are not taken. |
A file never costs you the submission. What was typed is stored first. A file that is too large, of another kind, or that there is no room for is not kept, the submission says which file and why, and everything else in it is there. On the page a plain form shows afterwards, the visitor is told that their file did not come along. Only a form over 25 MB in all is refused whole, with 413.
Files are private. They are kept in a private bucket in Amsterdam and nothing in it has a public address. In the app, Download asks the server for an address that works for one minute, and only a signed-in member of the project gets one. A key and an assistant over MCP can read a file’s name, type and size, and never the file. Every file is stored to be downloaded, never shown in the browser.
Storage is counted for the account, across its projects, against the room its plan has: 1 GB during the trial and on the smallest plan, and a gigabyte more for every 10,000 events of a larger one, so 2.5 GB on 25k, 10 GB on 100k and 100 GB on 1M. It does not reset with the month: a file takes room until its submission is deleted. Storage used is shown beside the month’s events, in the sidebar and under Setup, Usage. When it is full, a new file is not kept and its submission still is, and the account’s owner gets an email, once a month, that says so.
From a server
POST https://api.snekot.co/v1/form with a key in Authorization:
{ "form": "Contact", "fields": { "email": "[email protected]", "plan": "Studio", "message": "Hello" }, "page": "/contact" }
| Field | Type | |
|---|---|---|
form |
string | Required. The form’s name. |
fields |
object | Required. Field name to what was typed: text, a number, true or false, or a list of texts. |
page |
string | The path the form is on, such as /contact. |
visitor_id |
string | With a private key: the visitor who sent it, as on an event, so the submission joins their page views. |
The answer is 201 with { "ok": true, "form": "contact" }, and the submission’s id as well when the key is private.
What is worked out
- Field kinds. An address is an email wherever it is typed. A number in a field whose name says phone is a phone number. A long or many-lined text is long text. A field that only ever holds a few values, such as a plan or a team size, becomes a choice once a handful of submissions have arrived, and the app offers it as a filter.
- The person. The first email address in the submission ties it to the person with that address, or makes one, with the name from a
namefield or from first and last name. Their earlier page views in the same browser become theirs. - Where it came from. The page the form is on, the source that brought the visitor to the site, and their country.
Limits
| Fields in one submission | 40 |
| A field’s name | 64 characters |
| A field’s value | 5,000 characters |
| A submission in all | 20,000 characters |
| Forms in a project | 50 |
| From one visitor | 5 a minute, 30 an hour |
A submission past a limit is refused with 400, and one past the rate with 429. The limits on files are under Files: a file past one is not kept, and its submission is.
If the project has allowed sites, a form is taken only from them. A public key limited to some channels needs forms among them.
In the app
Forms lists each form with how many submissions it holds and how many are new. Inside one, the table has a column for each field, newest first, and narrows by status and by each field that is a choice. A submission opens with everything that was typed, its files to download, its status, one note and a way to the person. A submission or a whole form can be deleted, which cannot be undone.
There are no pipelines, deals or assignments, and nothing is sent from here: answer from your own mail and mark the submission Replied.
In the feed and on your phone
Every submission is also an event in the forms channel, named after the form, with who wrote and how the message began. So it shows in the feed and on the person’s timeline, a forwarding rule can send it on to Slack, email or a webhook, and it reaches your phone as a push notification. Stop notifying in a form’s menu turns the push off for that form.
Reading and changing with a key
With a read key or a private key:
| Endpoint | Parameters | Answers with |
|---|---|---|
GET /v1/forms |
Each form’s name, slug, how many submissions it holds, how many are unread, and latest_at. |
|
GET /v1/forms/:form/submissions |
status, q, field.<name>, limit, cursor |
The form’s fields with their kinds and choices, and its submissions, newest first, with counts by status and a next cursor. :form is the form’s slug or id. field.plan=Studio keeps the submissions whose plan is Studio; q matches anything typed. Up to 200 a request. |
GET /v1/submissions/:id |
One submission: its fields, files, email, user_id, source, page, country, status and note. |
A file field holds the file’s name in fields. files lists each file’s id, field, name, mime, bytes, whether it was kept, and when it was not, why, in refused: storage, type, size, count, unavailable or failed. A key cannot download a file.
With a private key:
| Endpoint | Body | |
|---|---|---|
PATCH /v1/submissions/:id |
{ "status": "replied", "note": "Called on Tuesday." } |
Sets the status (new, replied or done), the note, or both. The note is one text of up to 2,000 characters, replaced whole. |
DELETE /v1/submissions/:id |
Deletes the submission, its files and its event for good. |
An assistant connected over MCP has the same: list_forms, list_submissions and get_submission to read, update_submission and delete_submission to change.
What it counts as
Each submission is one event of the month, like any other. Past the month’s events it is held: it is stored and counted, and opens when the plan covers it. At twice the month’s events new submissions are refused, as events are. Its files count against the account’s file storage, which is a separate measure and not a monthly one.
Deleting
Deleting a submission deletes what was typed, its note, its event and its files, from the database and from the bucket. Erasing a person deletes their submissions and the files they sent with everything else of theirs, and deleting a form, a project or the account deletes all of the files in it. The room they took is free again at once.
Next Revenue