Documentation
Learn how to integrate InputHaven with your website or application.
Quick Start
- Create a free account
- Create a new form in the dashboard
- Copy your form ID
- Add the form to your website
- Start receiving submissions
HTML Form
The simplest integration. Works with any static site.
<form action="https://inputhaven.com/api/v1/submit" method="POST">
<input type="hidden" name="_form_id" value="YOUR_FORM_ID" />
<input type="text" name="name" placeholder="Name" required />
<input type="email" name="email" placeholder="Email" required />
<textarea name="message" placeholder="Message" required></textarea>
<button type="submit">Send</button>
</form>React / Next.js
Use fetch to submit forms from React applications.
import { useState } from "react";
export function ContactForm() {
const [status, setStatus] = useState("");
const handleSubmit = async (e) => {
e.preventDefault();
const formData = new FormData(e.target);
const res = await fetch("https://inputhaven.com/api/v1/submit", {
method: "POST",
body: formData,
});
if (res.ok) {
setStatus("Message sent!");
e.target.reset();
} else {
setStatus("Something went wrong.");
}
};
return (
<form onSubmit={handleSubmit}>
<input type="hidden" name="_form_id" value="YOUR_FORM_ID" />
<input type="text" name="name" placeholder="Name" required />
<input type="email" name="email" placeholder="Email" required />
<textarea name="message" placeholder="Message" required />
<button type="submit">Send</button>
{status && <p>{status}</p>}
</form>
);
}AJAX / Fetch
Submit via JSON for full control over the request and response.
const data = {
_form_id: "YOUR_FORM_ID",
name: "John Doe",
email: "john@example.com",
message: "Hello!"
};
const response = await fetch("https://inputhaven.com/api/v1/submit", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(data),
});
const result = await response.json();
// { success: true, submissionId: "..." }Special Fields
_form_id(required) Your form's unique ID_redirectURL to redirect after submission_gotchaHoneypot field for spam detection (should be hidden and empty)Spam Protection
InputHaven includes multiple layers of spam protection:
- Honeypot fields - Add a hidden field that bots will fill but humans won't
- Keyword filtering - Automatic detection of common spam keywords
- AI spam filtering - Claude-powered spam classification (Starter+ plans)
- Rate limiting - Per-IP and per-form rate limits prevent abuse
- Domain allowlist - Restrict which domains can submit to your form
Webhooks
Configure a webhook URL in your form settings to receive submissions via HTTP POST. Webhooks are signed with HMAC-SHA256 for verification.
The signature is sent in the X-InputHaven-Signature header.
API Reference
Full API documentation is available at /openapi.yaml
Submit a form
POST /api/v1/submit
Accepts JSON, form-encoded, or multipart form data. Include _form_id in the body or X-Form-Id header.