Skip to content

HTML forms

Any standard HTML form can post directly to SubmitOwl with no JavaScript required.

Set method="POST" and point action to your form endpoint. Your FORM_ID is public and safe to include in HTML.

<form action="https://api.submitowl.com/f/FORM_ID" method="POST">
<label>
Name
<input type="text" name="name" required />
</label>
<label>
Email
<input type="email" name="email" required />
</label>
<label>
Message
<textarea name="message" required></textarea>
</label>
<!-- Hidden honeypot field for spam filtering -->
<input
type="text"
name="_gotcha"
tabindex="-1"
autocomplete="off"
aria-hidden="true"
style="display: none"
/>
<button type="submit">Send message</button>
</form>

By default, HTML forms submit as application/x-www-form-urlencoded. If you set enctype="multipart/form-data", SubmitOwl also accepts multipart requests without files. On plans without file upload support, submitting a real file returns 415 files_not_supported; an empty file input is ignored.

Reserved fields control submission behavior and are not stored in the submission payload. See the full list in Reserved fields and errors.

<input type="hidden" name="_redirect" value="https://example.com/thank-you" />
<input type="hidden" name="_subject" value="New contact form message" />
  • _redirect: URL to send the visitor to via 303 redirect after a browser form post succeeds.
  • _subject: custom subject line for notification emails (up to 150 characters; newlines are stripped).
  • _replyto: sets the notification email Reply-To address when valid. In ordinary contact forms, your visitor’s email input is enough because a valid email field is used as Reply-To automatically (and remains stored as submission data). Use _replyto only when your form collects the reply address in a field named _replyto or sets it dynamically rather than using email; _replyto is not stored as submission data.

SubmitOwl negotiates whether to return a redirect or JSON from browser fetch metadata and Accept headers. For JavaScript submissions, send Accept: application/json and read the JSON response directly.

<form id="contact-form" action="https://api.submitowl.com/f/FORM_ID" method="POST">
<input type="text" name="name" placeholder="Name" required />
<input type="email" name="email" placeholder="Email" required />
<textarea name="message" placeholder="Message" required></textarea>
<input
type="text"
name="_gotcha"
tabindex="-1"
autocomplete="off"
aria-hidden="true"
style="display: none"
/>
<button type="submit">Send</button>
<p id="form-status" role="status"></p>
</form>
<script>
const form = document.getElementById("contact-form");
const status = document.getElementById("form-status");
form.addEventListener("submit", async (event) => {
event.preventDefault();
status.textContent = "Sending...";
const response = await fetch(form.action, {
method: "POST",
body: new FormData(form),
headers: { Accept: "application/json" },
});
const data = await response.json();
if (data.ok) {
status.textContent = "Message sent.";
form.reset();
} else {
status.textContent = data.error?.message ?? "Submission failed.";
}
});
</script>

Success:

{ "ok": true, "id": "01JD..." }

Error:

{
"ok": false,
"error": {
"code": "rate_limited",
"message": "Too many requests"
}
}

CORS headers are included on all public endpoint responses, including 4xx and 5xx errors, so browser JavaScript can inspect data.error.code and data.error.message.