Start here

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.

Updated 2026年11月29日

4 min read

Step 1: Create a form

  1. Open Forms

    In the dashboard, open Forms and press New form. Give it a name, for example *Contact*.

  2. 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.

  3. Add recipients

    Open the Email tab, add up to 10 email addresses and press Send a test email.

A submission is saved before the email goes out. If the email fails, the submission is still in the dashboard, and the email is retried.

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

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

js
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

ts
import { submitForm } from "cmskite";

await submitForm("frm_YOUR_FORM_ID", new FormData(formElement));
Never put a CMSKite API key in your website's code. The form endpoint is public and needs no key.

Special fields

Fields whose name starts with _ give instructions. They are read, then left out of the saved submission.

FieldWhat it does
_gotchaSpam trap. Hide it. A bot that fills it gets a normal answer, but nothing is saved or emailed.
_redirect or _nextWhere 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.
_subjectThe subject line of the notification email.
_replytoThe visitor's email, used as Reply-To. Without it, a valid email field is used.
cf-turnstile-responseThe 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

MethodPathWhat it doesAuth
POST/v1/public/forms/{formId}Send one submissionNone
ItemValue
Body typesapplication/json, application/x-www-form-urlencoded, multipart/form-data (text fields only), text/plain holding JSON
SizeAt most 64 KB and 50 fields. Field names up to 100 characters, values up to 10,000 characters, lists up to 20 values.
AnswerJSON when the request is JSON or sends Accept: application/json. A browser form post gets a thank-you page (200) or a 303 redirect.
DuplicatesSend an Idempotency-Key header. A repeat with the same key returns the first submission's id and saves nothing new.
Rate limitPer visitor IP: a burst of 10, then 1 a second. Over the limit you get 429 with Retry-After.
Kept for365 days by default. Change it from 1 to 730 days with Keep submissions for (days) in Settings.

curl

bash
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.

Allowed sites are an extra check, not a secret. A script can fake the 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.

HTTPCodeReasonWhat to do
400INVALID_REQUESTEMPTY_SUBMISSIONSend at least one field.
400INVALID_REQUESTINVALID_BODYSend valid JSON or form data, as an object of fields.
400INVALID_REQUESTNESTED_VALUESend text, numbers, booleans or lists of those. No nested objects.
400INVALID_REQUESTTOO_MANY_FIELDS, TOO_MANY_VALUES, FIELD_TOO_LONG, FIELD_NAME_TOO_LONGStay within the size limits above.
400INVALID_REQUESTCAPTCHA_FAILEDLet the visitor solve the CAPTCHA again and resend.
403FORBIDDENDOMAIN_NOT_ALLOWEDAdd the website to Allowed sites in Settings.
403FORBIDDENFORM_PAUSEDTurn Take submissions back on in Settings.
403ENTITLEMENT_REQUIREDThe workspace plan does not include forms.
404NOT_FOUNDCheck the form id. A deleted form answers 404.
413PAYLOAD_TOO_LARGEBODY_TOO_LARGEKeep the body under 64 KB.
415UNSUPPORTED_MEDIA_TYPEFILES_NOT_SUPPORTEDRemove file inputs.
415UNSUPPORTED_MEDIA_TYPEUNSUPPORTED_CONTENT_TYPEUse one of the body types above.
429RATE_LIMIT_EXCEEDEDWait 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.com as well as example.com.
  • A bot test shows success but nothing is saved. The _gotcha field 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-Type and Idempotency-Key headers.