Forms: collect submissions from any website
Create a form in the dashboard and you get an endpoint URL. Send your website's form to that URL. Each submission is saved under **Forms** > **Submissions**, and the people you choose get it by email. You do not need a server.
Step 1: Create a form
Open Forms
In the dashboard, open Forms and press New form. Give it a name, for example *Contact*.
Copy the endpoint
Open the form, then Install. Copy the endpoint URL. It looks like
https://api.cmskite.com/v1/public/forms/frm_YOUR_FORM_ID.Add recipients
Open the Email tab, add up to 10 email addresses and press Send a test email.
Step 2: Send your form to the endpoint
The simplest way is a plain HTML form. It works on any website builder that lets you paste HTML. After a send, the visitor sees a thank-you page, or goes to the redirect address you set.
HTML
<form action="https://api.cmskite.com/v1/public/forms/frm_YOUR_FORM_ID" method="POST">
<label>Email <input type="email" name="email" required></label>
<label>Message <textarea name="message" required></textarea></label>
<!-- Spam trap: keep it hidden and empty -->
<input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off">
<button type="submit">Send</button>
</form>To stay on the page, send the form with fetch and ask for JSON:
fetch
const res = await fetch("https://api.cmskite.com/v1/public/forms/frm_YOUR_FORM_ID", {
method: "POST",
headers: { "Content-Type": "application/json", Accept: "application/json" },
body: JSON.stringify({ email: "ana@example.com", message: "Hello" }),
});
const body = await res.json();
// { success: true, data: { status: "received", id: "fsub_..." } }With the SDK, use submitForm. It needs no API key, so it is safe in the browser:
SDK
import { submitForm } from "cmskite";
await submitForm("frm_YOUR_FORM_ID", new FormData(formElement));Special fields
Fields whose name starts with _ give instructions. They are read, then left out of the saved submission.
| Field | What it does |
|---|---|
_gotcha | Spam trap. Hide it. A bot that fills it gets a normal answer, but nothing is saved or emailed. |
_redirect or _next | Where the browser goes after a send. Allowed only to the page's own website, your allowed sites or the address in After sending, go to. Other addresses are ignored. |
_subject | The subject line of the notification email. |
_replyto | The visitor's email, used as Reply-To. Without it, a valid email field is used. |
cf-turnstile-response | The Cloudflare Turnstile token, when the form has CAPTCHA turned on. |
- Values are text. A number, a boolean or a list of those is also fine. A list is saved as a list (for example several checkboxes with the same name).
- File uploads are not supported yet. Send text fields only.
- The notification email comes from CMSKite. The visitor's address is only the Reply-To.
API reference
| Method | Path | What it does | Auth |
|---|---|---|---|
| POST | /v1/public/forms/{formId} | Send one submission | None |
| Item | Value |
|---|---|
| Body types | application/json, application/x-www-form-urlencoded, multipart/form-data (text fields only), text/plain holding JSON |
| Size | At most 64 KB and 50 fields. Field names up to 100 characters, values up to 10,000 characters, lists up to 20 values. |
| Answer | JSON when the request is JSON or sends Accept: application/json. A browser form post gets a thank-you page (200) or a 303 redirect. |
| Duplicates | Send an Idempotency-Key header. A repeat with the same key returns the first submission's id and saves nothing new. |
| Rate limit | Per visitor IP: a burst of 10, then 1 a second. Over the limit you get 429 with Retry-After. |
| Kept for | 365 days by default. Change it from 1 to 730 days with Keep submissions for (days) in Settings. |
curl
curl -X POST "https://api.cmskite.com/v1/public/forms/frm_YOUR_FORM_ID" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1234" \
-d '{"email":"ana@example.com","message":"Hello"}'Reading and managing submissions (list, mark as read, spam, delete, analytics) is done in the dashboard. It is not part of the public API yet.
CORS and allowed websites
The endpoint answers CORS from any website (Access-Control-Allow-Origin: *). Browsers may send Content-Type and Idempotency-Key. A text/plain body is read as JSON, so navigator.sendBeacon and simple fetch calls skip the preflight.
To accept posts only from your own sites, list them under Settings > Allowed sites, one per line (up to 20). *.example.com matches example.com and every subdomain. Then a post must come from a page on one of those sites. A request with no Origin or Referer header (such as plain curl) is refused with DOMAIN_NOT_ALLOWED.
Origin header. Use the spam trap and CAPTCHA against bots.Error codes
Errors use the standard error shape. The details.reason field says exactly what went wrong.
| HTTP | Code | Reason | What to do |
|---|---|---|---|
| 400 | INVALID_REQUEST | EMPTY_SUBMISSION | Send at least one field. |
| 400 | INVALID_REQUEST | INVALID_BODY | Send valid JSON or form data, as an object of fields. |
| 400 | INVALID_REQUEST | NESTED_VALUE | Send text, numbers, booleans or lists of those. No nested objects. |
| 400 | INVALID_REQUEST | TOO_MANY_FIELDS, TOO_MANY_VALUES, FIELD_TOO_LONG, FIELD_NAME_TOO_LONG | Stay within the size limits above. |
| 400 | INVALID_REQUEST | CAPTCHA_FAILED | Let the visitor solve the CAPTCHA again and resend. |
| 403 | FORBIDDEN | DOMAIN_NOT_ALLOWED | Add the website to Allowed sites in Settings. |
| 403 | FORBIDDEN | FORM_PAUSED | Turn Take submissions back on in Settings. |
| 403 | ENTITLEMENT_REQUIRED | The workspace plan does not include forms. | |
| 404 | NOT_FOUND | Check the form id. A deleted form answers 404. | |
| 413 | PAYLOAD_TOO_LARGE | BODY_TOO_LARGE | Keep the body under 64 KB. |
| 415 | UNSUPPORTED_MEDIA_TYPE | FILES_NOT_SUPPORTED | Remove file inputs. |
| 415 | UNSUPPORTED_MEDIA_TYPE | UNSUPPORTED_CONTENT_TYPE | Use one of the body types above. |
| 429 | RATE_LIMIT_EXCEEDED | Wait for Retry-After seconds, then resend. |
Troubleshooting
- No email arrived. Open the submission. Its notification status says *sent*, *failed* or *pending*, with the error per recipient. Check spam folders, then press Send test email on the Email tab.
- Submission is in Spam. The spam filter moved it. Open it and press Not spam. Turn off Spam filter in Settings if it catches real posts.
- My `_redirect` is ignored. The address is on another website. Add that site to Allowed sites, or set After sending, go to in Settings.
- 403 `DOMAIN_NOT_ALLOWED` from my own site. List the exact host, for example
www.example.comas well asexample.com. - A bot test shows success but nothing is saved. The
_gotchafield was filled. That is the spam trap working. - CORS error in the browser console. Check that the URL is the endpoint from Install, and that you send only
Content-TypeandIdempotency-Keyheaders.