Contact Form
Octocom makes it easy to collect customer inquiries through contact forms that connect directly to your AI-powered inbox. You can launch a form with zero code or integrate it directly in your site using our API.
Prerequisites
Before you add a contact form, make sure you have:
✅ An email integration connected and configured with Octocom
✅ The AI replies to new emails toggle turned on (if you want Octocom to automatically respond to inquiries)
✅ Your Octocom business slug that you can find in the contact form settings in the dashboard
Options for launching a contact form
You can set up a contact form in three ways:
Hosted form (no coding required)
JSON API call (client-side integration)
Multipart form (with file upload support)
1. Hosted form (no code required)
The easiest way to get started is to use a hosted Octocom form.
Octocom provides a hosted form under a dedicated URL.
You can link your site’s “Contact Us” button to this URL.
Example: Live hosted form →
To request a hosted form for your business, contact your account manager or Octocom support.
2. Submitting inquiries via JSON API
If you prefer embedding your own form, you can send inquiries directly to Octocom with a JSON POST
request.
Endpoint
POST https://api.octocom.ai/contact-forms/submit-inquiry
Example
fetch("https://api.octocom.ai/contact-forms/submit-inquiry", {
method: "POST",
body: JSON.stringify({
businessSlug: "your-business-slug",
customerEmail: values.email,
customerName: values.fullName,
inquiryText: values.message,
reason: values.reason,
}),
headers: {
"Content-Type": "application/json",
},
});
Request schema
Octocom validates incoming JSON payloads using this schema:
body: {
businessSlug: string, // Required. Found in Contact Form settings.
customerEmail: string, // Required. Must be a valid email.
customerName?: string,
subject?: string,
reason?: string,
inquiryText: string, // Required. Min 1 character.
orderId?: string,
additionalFields?: Record<string, string>,
files?: Array<{
name?: string,
url: string, // Must be a valid URL
contentType: string,
}>
}
⚠️ Note: For JSON API submissions, any files must already be uploaded to your own hosting system. You’ll pass file URLs to Octocom.
3. Multipart form (with file upload support)
If you want Octocom to handle file uploads directly, use the multipart form endpoint.
Endpoint
POST https://api.octocom.ai/contact-forms/submit-inquiry-multipart
Files are included as standard multipart attachments.
The business slug is passed via the
x-octocom-business-slug
header.
Schema (form fields)
{
customerEmail: string, // Required
customerName?: string,
subject?: string,
inquiryText: string, // Required
orderId?: string,
reason?: string
}
Example HTML form
Here’s a ready-to-use form that submits directly to Octocom with file upload support:
<form id="contact-form" enctype="multipart/form-data" method="POST">
<label>Email*</label>
<input type="email" name="customerEmail" required>
<label>Name</label>
<input type="text" name="customerName">
<label>Subject*</label>
<input type="text" name="subject" required>
<label>Inquiry*</label>
<textarea name="inquiryText" required></textarea>
<label>Order ID</label>
<input type="text" name="orderId">
<label>Attachments</label>
<input type="file" name="attachments[]" multiple>
<button type="submit">Submit Inquiry</button>
</form>
<script>
document.getElementById("contact-form").addEventListener("submit", async (e) => {
e.preventDefault();
const formData = new FormData(e.target);
const res = await fetch("https://api.octocom.ai/contact-forms/submit-inquiry-multipart", {
method: "POST",
body: formData,
headers: { "x-octocom-business-slug": "your-business-slug" }
});
if (res.ok) alert("Your inquiry was submitted successfully.");
else alert("Something went wrong.");
});
</script>
Choosing the right option
Hosted form
Fastest setup, no coding required
JSON API
You already manage file uploads and want full UI control
Multipart form
You want Octocom to handle file uploads for you
Security considerations
Rate limits
Octocom applies aggressive rate limits to protect against abuse. This ensures that spam operations attempting to use another business’s slug cannot scale.
If spam is happening at a low volume (under rate limit thresholds), it will usually be detected by human agents quickly. In such cases, report it to Octocom — we’ll propose solutions and remove the spam conversations so the victim doesn’t incur additional charges.
No API keys
Since contact form integrations are publicly visible in a site’s source code, API keys would provide no protection. Instead, Octocom recommends adding captchas and leveraging firewall providers (such as Cloudflare) to block automated spam.
Handling frequent spam
Preferred option: Expose a public-facing email address instead of a form. Email providers like Gmail and Outlook have strong, battle-tested spam filters.
If forms must be used: Contact your Octocom account manager. We can coordinate more advanced anti-spam measures such as one-time tokens and other custom solutions.
Last updated