Experience D · Technical documentation
Docs that developers love
Real documentation for this website's own Inquiry API — with search, sidebar navigation, multi-language code samples, copy buttons and responsive tables.
7 sections match
Getting started
Overview
The Inquiry API accepts project, quote, course and general inquiries submitted from maazahmed.com. It validates every request on the server, applies spam protection and forwards valid inquiries by email.
This is the real API behind the forms on this website. Requests are accepted only from the site's own origin.
Getting started
Quick start
- 1Collect the visitor's name, email and message in a form.
- 2Record the time the form was rendered (startedAt, in milliseconds).
- 3POST the JSON payload to /api/inquiry.
- 4Show a success state when the response contains "ok": true.
curl -X POST https://maazahmed.com/api/inquiry \
-H "Content-Type: application/json" \
-H "Origin: https://maazahmed.com" \
-d '{
"type": "project",
"name": "Ada Lovelace",
"email": "ada@example.com",
"message": "We need a Moodle course built for 40 staff.",
"consent": true,
"startedAt": 1760860800000
}'Reference
POST/api/inquiry
Creates a new inquiry. The request body must be JSON and no larger than 20 KB.
| Field | Type | Required | Description |
|---|---|---|---|
| type | enum | Yes | One of project, quote, course, general. |
| name | string | Yes | 2–100 characters. |
| string | Yes | A valid email address, max 200 characters. | |
| message | string | Yes | 20–5000 characters. |
| consent | boolean | Yes | Must be true — the visitor agrees to be contacted. |
| startedAt | integer | Yes | Unix time in ms when the form was rendered. |
| company | string | No | Organisation name, max 150 characters. |
| service | string | No | Service of interest, max 120 characters. |
| budget | string | No | Budget band, max 60 characters. |
| timeline | string | No | Desired timeline, max 60 characters. |
| source | string | No | Page or campaign identifier, max 200 characters. |
| turnstileToken | string | Cond. | Required when Turnstile spam protection is enabled. |
Reference
Responses
{
"ok": true
}Reference
Error codes
| Status | Meaning | How to fix |
|---|---|---|
| 400 | Malformed JSON or failed spam check | Send valid JSON; refresh the Turnstile token. |
| 403 | Origin not allowed | Submit from maazahmed.com. |
| 405 | Method not allowed | Use POST. |
| 413 | Body too large | Keep the payload under 20 KB. |
| 415 | Unsupported content type | Send Content-Type: application/json. |
| 422 | Validation failed | Read the fields object and correct each value. |
| 502 | Email delivery failed | Retry later or use another contact method. |
| 503 | Delivery not configured | The site owner hasn't enabled delivery yet. |
Guides
Spam protection
Three layers keep inquiries clean without frustrating real people:
- 1Honeypot: a hidden website field that people never see. If it is filled, the request is silently discarded.
- 2Timing: submissions faster than 3 seconds after render are treated as automated.
- 3Cloudflare Turnstile (optional): a privacy-friendly challenge verified server-side.
Bot submissions receive a normal-looking success response so automated scripts learn nothing about the filters.
Guides
Data & privacy
Inquiry data is used only to reply to the sender. It is delivered by email and not stored in a database by this API. See the privacy policy for full details.
What this demonstrates
- —Information architecture for API docs
- —Code samples in cURL, JavaScript & Python
- —Error reference tables
- —Search with highlighted matches