Documentation

Everything you need to integrate FastForms LK into your website. No backend code required.

Quick Start

Get your first form up and running in under 2 minutes:

  1. Create an account and log in to the dashboard
  2. Click "New form" to create your first form
  3. Copy the endpoint URL provided
  4. Add it to your HTML form's action attribute
  5. Submissions will appear in your dashboard instantly

Creating a Form

From your dashboard, click the New form button. Fill in:

Once created, you'll receive a unique endpoint URL like:

https://forms.mathila.web.lk/api/f/your-form-id

HTML Integration

Point any HTML form's action attribute to your endpoint:

<form action="https://forms.mathila.web.lk/api/f/your-form-id" method="POST">
  <input type="text" name="name" placeholder="Your name" required>
  <input type="email" name="email" placeholder="Your email" required>
  <textarea name="message" placeholder="Your message"></textarea>
  <button type="submit">Send</button>
</form>

Form Fields

FastForms accepts any fields you send. There's no schema to configure — just add inputs with name attributes:

All field names and values are stored exactly as submitted.

API Endpoint

Each form has a unique endpoint:

POST https://forms.mathila.web.lk/api/f/{formId}

Supports both application/x-www-form-urlencoded (default for HTML forms) and application/json content types.

Using JavaScript Fetch

const form = document.querySelector('form');
form.addEventListener('submit', async (e) => {
  e.preventDefault();
  const formData = new FormData(form);
  
  const response = await fetch('https://forms.mathila.web.lk/api/f/your-form-id', {
    method: 'POST',
    headers: { 'Accept': 'application/json' },
    body: formData,
  });
  
  const result = await response.json();
  console.log(result);
});

API Responses

Successful submissions return:

{
  "ok": true,
  "message": "Submission received successfully."
}

For native HTML form submissions (without Accept: application/json), the API will redirect to your configured redirect URL (if set).

Error Handling

All errors follow a consistent format:

{
  "ok": false,
  "error": "ERROR_CODE",
  "message": "Human-readable description"
}

Common Error Codes

CodeStatusDescription
FORM_NOT_FOUND404No form exists with this ID
FORM_INACTIVE403Form is paused and not accepting submissions
RATE_LIMIT_EXCEEDED429Too many submissions from this IP
TOO_MANY_FIELDS400More than 40 fields submitted
PAYLOAD_TOO_LARGE413Submission exceeds 25KB
INVALID_BODY400Could not parse the request body
EMPTY_SUBMISSION400No form fields were received

Spam Protection

FastForms includes built-in spam protection:

Honeypot Field

Add a hidden input field to trap bots. Real users won't see it, but bots will fill it in:

<input type="text" name="_gotcha" style="display:none" tabindex="-1" autocomplete="off">

Submissions with a filled honeypot field are silently accepted (the bot thinks it worked) but never stored or emailed.

Rate Limiting

Each IP address is limited to 10 submissions per form per minute to prevent abuse.