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.
Live in 3 steps
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.
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).
Add the HTML below to your page. Replace YOUR_API_KEY with your key and you are done.
<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
https://api.formsend.ezeroandone.io/submitAccepts 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.
Browser-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
| Field | Type | Required | Description |
|---|---|---|---|
api_key | string | Required | Your website API key from the dashboard. Identifies which site this submission belongs to. |
name | string | Required | Sender's full name. Max 255 characters. |
email | string | Required | Sender's email address. Must be a valid email format. Used as the reply-to address. |
message | string | Required | Body of the message. Max 5 000 characters. |
subject | string | Optional | Email subject line. Max 255 characters. Defaults to "New form submission from {name}" if omitted. |
…extras | string | Optional | Any 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
{
"success": true,
"message": "Message sent successfully."
}Error — 4xx / 5xx
{
"success": false,
"message": "Unauthorized: Invalid API key."
}Error reference
| Status | Message | What to do |
|---|---|---|
| 400 | Missing required fields | name, email, or message is absent from the request body. |
| 400 | Invalid sender email format | The email field is not a valid email address. |
| 400 | Name / message too long | name exceeds 255 chars or message exceeds 5 000 chars. |
| 401 | Missing API key | The api_key field was not included in the request. |
| 401 | Invalid API key | The api_key does not match any registered website. Check you copied it correctly from the dashboard. |
| 403 | Origin not allowed | The HTTP Origin header hostname does not match the domain registered in the dashboard. Register the exact hostname your site is served from. |
| 403 | Email not verified | The notification email for this website has not been verified yet. Check your inbox or use Resend email in the dashboard. |
| 429 | Too many requests | More than the allowed number of submissions were sent from the same IP within 10 minutes. Slow down and retry later. |
| 500 | Failed to send email | A transient error on the mail-delivery side. Retry the request. |
Code examples
Plain HTML form
<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.
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
$("#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)
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 URL | Register as |
|---|---|
https://example.com | example.com |
https://www.example.com | www.example.com |
https://app.example.com | app.example.com |
www 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
Ready to integrate?
Sign in, register your website, and have your first form live in under a minute.
Go to dashboard