Plain HTML
<form action="https://api.usemektup.com/submit" method="POST">
<input type="hidden" name="access_key" value="YOUR_ACCESS_KEY">
<input type="hidden" name="redirect" value="https://yoursite.com/thanks">
<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>
<!-- honeypot: hidden from people, bots fill it in -->
<input type="checkbox" name="botcheck" style="display:none" tabindex="-1" autocomplete="off">
<button type="submit">Send</button>
</form>Every field you include appears in the email under its own name. Special fields: email (or replyto) sets Reply-To, subject overrides the subject, redirect sends the visitor to your thank-you page, and botcheck is the honeypot.
JavaScript, without leaving the page
const form = document.querySelector("#contact");
form.addEventListener("submit", async (event) => {
event.preventDefault();
const res = await fetch("https://api.usemektup.com/submit", {
method: "POST",
headers: { Accept: "application/json" },
body: new FormData(form),
});
const { success, message } = await res.json();
form.querySelector(".status").textContent = success ? "Thanks, we'll be in touch." : message;
});With Accept: application/json the endpoint answers { "success": true, "message": "..." } instead of a page, so you can show your own message.
From server code
import requests
# e.g. from a Django or Flask view, a script or a webhook
requests.post(
"https://api.usemektup.com/submit",
json={
"access_key": "YOUR_ACCESS_KEY",
"name": "Ava Chen",
"email": "ava@chenstudio.com",
"subject": "Quote request",
"message": "We need a new site by March.",
},
headers={"Accept": "application/json"},
timeout=10,
)Create the form
- Add your domain and the mailbox that should receive the submissions, for example
contact@. - Create a form in the dashboard under Forms, or with
POST /v1/forms, and choose that mailbox. - Copy the access key into your form's hidden field.
Because submissions land in a real mailbox, you can answer them in webmail or your mail app, hand them to an AI agent through the mailbox's webhook, or both.