Skip to main content
All Docs
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

FieldTypeRequiredValidation
namestring1–200 characters
emailstringValid email format; max 320 characters
companyNamestringMax 200 characters
telephonestringMax 30 characters
inquiryTypeenumOne of: request_demo, call_back, support_query, more_information, other
messagestring1–5,000 characters
gdprConsenttrueMust 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

  1. Database persistence — the submission is always written to the contactInquiries table on success.
  2. Email notification — a notification is sent to CONTACT_FORM_NOTIFY_EMAIL if 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

VariableEffect
CONTACT_FORM_NOTIFY_EMAILIf set (and email is configured), a notification email is sent to this address for each new submission