API ReferencePurple PepperUpdated April 7, 2026
POST /api/contact
POST /api/contact
Submits a contact inquiry. This is a public endpoint — no authentication is required.
Request
Method: POST
Path: /api/contact
Content-Type: application/json
Body Parameters
| Field | Type | Required | Validation |
|---|---|---|---|
name | string | ✅ | 1–200 characters |
email | string | ✅ | Valid email format; max 320 characters |
companyName | string | ❌ | Max 200 characters |
telephone | string | ❌ | Max 30 characters |
inquiryType | enum | ✅ | One of: request_demo, call_back, support_query, more_information, other |
message | string | ✅ | 1–5,000 characters |
gdprConsent | true | ✅ | Must be the boolean true |
Example Request
POST /api/contact
Content-Type: application/json
{
"name": "Jane Smith",
"email": "jane@example.com",
"companyName": "Acme Ltd",
"telephone": "+44 7700 900000",
"inquiryType": "request_demo",
"message": "We'd love to see a demo of the platform.",
"gdprConsent": true
}
Responses
201 Created — Success
{
"success": true,
"id": "<inquiry-uuid>"
}
400 Bad Request — Validation Failed
Returned when one or more fields fail validation. The details object maps field names to arrays of error messages.
{
"error": "Validation failed",
"details": {
"email": ["Please enter a valid email address"],
"gdprConsent": ["You must consent to data processing to submit this form"]
}
}
500 Internal Server Error — Unexpected Error
{
"error": "An unexpected error occurred. Please try again later."
}
Side Effects
- Database persistence — the submission is always written to the
contactInquiriestable on success. - Email notification — a notification is sent to
CONTACT_FORM_NOTIFY_EMAILif both the email integration is active and the environment variable is configured. Failure to send the email does not affect the HTTP response.
IP Capture
The endpoint captures the submitter's IP address from the X-Forwarded-For or X-Real-IP request headers and stores it alongside the inquiry for GDPR audit purposes.
Environment Variables
| Variable | Effect |
|---|---|
CONTACT_FORM_NOTIFY_EMAIL | If set (and email is configured), a notification email is sent to this address for each new submission |