menu_bookDocumentation

FormSend API Docs

Everything you need to integrate a working contact form into any website in under a minute. No backend required — just an HTML snippet and your API key.

How FormSend works

FormSend is a hosted form-submission API. You register your website domain in the dashboard, get an API key, and embed a short HTML form. When a visitor submits the form, FormSend validates the request, checks your domain and key, and delivers the message to your registered notification email via Resend.

vpn_key
API-key auth
Each website has its own key. No shared secrets.
verified_user
Origin verified
Submissions only accepted from your registered domain.
mark_email_read
Email delivery
Messages land in your inbox via Resend infrastructure.
block
Rate limited
Built-in per-IP throttling blocks form spam.

Live in 3 steps

1
loginSign in & register your website

Go to your dashboard, log in with Google, click Add a website, enter your domain (e.g. mysite.com) and the email address where you want to receive submissions. A verification email will be sent — click the link inside it.

2
vpn_keyCopy your API key

After adding your website, the dashboard shows your API key once. Copy it immediately — it is only shown at creation (or after a key rotation).

3
codePaste the form snippet

Add the HTML below to your page. Replace YOUR_API_KEY with your key and you are done.

contact.html
<form
  action="https://api.formsend.ezeroandone.io/submit"
  method="POST"
>
  <input type="hidden" name="api_key" value="YOUR_API_KEY" />
  <input type="text"   name="name"    placeholder="Your name"    required />
  <input type="email"  name="email"   placeholder="your@email.com" required />
  <input type="text"   name="subject" placeholder="Subject" />
  <textarea            name="message" placeholder="Your message" required></textarea>
  <button type="submit">Send</button>
</form>

Submit endpoint

POSThttps://api.formsend.ezeroandone.io/submit

Accepts JSON (Content-Type: application/json) or a standard HTML form POST (application/x-www-form-urlencoded / multipart/form-data). CORS is open — any origin can POST, but the Origin header must match your registered domain.

infoBrowser-submitted forms automatically send the Origin header. When testing with cURL or Postman there is no Origin, so the origin check is skipped — that is expected.

Request fields

FieldTypeRequiredDescription
api_keystringRequiredYour website API key from the dashboard. Identifies which site this submission belongs to.
namestringRequiredSender's full name. Max 255 characters.
emailstringRequiredSender's email address. Must be a valid email format. Used as the reply-to address.
messagestringRequiredBody of the message. Max 5 000 characters.
subjectstringOptionalEmail subject line. Max 255 characters. Defaults to "New form submission from {name}" if omitted.
…extrasstringOptionalAny additional fields (e.g. phone, company, service) are forwarded in the email as extra rows.

Response format

Every response is JSON with a success boolean and a human-readable message.

Success — 200

response.json
{
  "success": true,
  "message": "Message sent successfully."
}

Error — 4xx / 5xx

response.json
{
  "success": false,
  "message": "Unauthorized: Invalid API key."
}

Error reference

StatusMessageWhat to do
400Missing required fieldsname, email, or message is absent from the request body.
400Invalid sender email formatThe email field is not a valid email address.
400Name / message too longname exceeds 255 chars or message exceeds 5 000 chars.
401Missing API keyThe api_key field was not included in the request.
401Invalid API keyThe api_key does not match any registered website. Check you copied it correctly from the dashboard.
403Origin not allowedThe HTTP Origin header hostname does not match the domain registered in the dashboard. Register the exact hostname your site is served from.
403Email not verifiedThe notification email for this website has not been verified yet. Check your inbox or use Resend email in the dashboard.
429Too many requestsMore than the allowed number of submissions were sent from the same IP within 10 minutes. Slow down and retry later.
500Failed to send emailA transient error on the mail-delivery side. Retry the request.

Code examples

Plain HTML form

contact.html
<form
  action="https://api.formsend.ezeroandone.io/submit"
  method="POST"
>
  <input type="hidden" name="api_key" value="YOUR_API_KEY" />
  <input type="text"   name="name"    placeholder="Your name"    required />
  <input type="email"  name="email"   placeholder="your@email.com" required />
  <input type="text"   name="subject" placeholder="Subject" />
  <textarea            name="message" placeholder="Your message" required></textarea>
  <button type="submit">Send</button>
</form>

JavaScript / fetch (AJAX)

Use this approach to handle the response in JS and show a success/error message without a page reload.

submit.js
const res = await fetch("https://api.formsend.ezeroandone.io/submit", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    api_key: "YOUR_API_KEY",
    name: "Jane Smith",
    email: "jane@example.com",
    subject: "Hello",
    message: "This is a test submission.",
  }),
});

const data = await res.json();
// { success: true, message: "Message sent successfully." }

jQuery

submit.js
$("#contactForm").on("submit", function (e) {
  e.preventDefault();
  $.ajax({
    url: "https://api.formsend.ezeroandone.io/submit",
    method: "POST",
    contentType: "application/json",
    data: JSON.stringify({
      api_key: "YOUR_API_KEY",
      name:    $("#name").val(),
      email:   $("#email").val(),
      subject: $("#subject").val(),
      message: $("#message").val(),
    }),
    success: function (data) { console.log("Sent!", data); },
    error:   function (xhr)  { console.error(xhr.responseJSON); },
  });
});

cURL (testing)

terminal
curl -X POST https://api.formsend.ezeroandone.io/submit \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "YOUR_API_KEY",
    "name":    "Jane Smith",
    "email":   "jane@example.com",
    "subject": "Hello",
    "message": "This is a test."
  }'

Registering your domain

FormSend checks the Origin header of each browser submission against the domain you registered. You need to register the exact hostname your site is served from.

Site URLRegister as
https://example.comexample.com
https://www.example.comwww.example.com
https://app.example.comapp.example.com

warningwww vs non-www matters. If you register example.com but your page is served from www.example.com, the submission will be rejected with 403 Forbidden: Origin not allowed. Register both separately if needed.

Frequently asked questions

QDo I need a backend or server?
No. The entire integration is client-side HTML. FormSend's API handles everything on the server side.
QCan I use it with React, Vue, Webflow, or Framer?
Yes. Any tool that can make an HTTP POST request works. Use the plain HTML snippet, the fetch example, or any HTTP client.
QWhere does the email go?
To the notification email you registered for the website in the dashboard. Every submission is sent there as a formatted email with all field values.
QCan I pass extra fields like phone or company?
Yes. Any field beyond the reserved ones (api_key, name, email, message, subject) is forwarded as an extra row in the email. Just add it to your form.
QWhat is the rate limit?
Submissions are rate-limited per IP address. Hitting the limit returns a 429 with a message asking the user to wait 10 minutes.
QMy key stopped working after I clicked Rotate key — why?
Key rotation immediately invalidates the old key. You must update your form's api_key hidden input to the new key shown in the dashboard.
QI'm getting 403 Forbidden: Origin not allowed. What's wrong?
The hostname in the browser's Origin header doesn't match the domain you registered. Check for www vs non-www mismatches, or a subdomain difference.
QDoes FormSend store my form submissions?
No. FormSend delivers submissions to your email and does not store message content in any database.
rocket_launch

Ready to integrate?

Sign in, register your website, and have your first form live in under a minute.

Go to dashboard