Complete reference for all API endpoints, request/response formats, and integration examples.
https://your-backend.com
Currently, the API uses CORS origin validation. Requests must come from allowed origins configured in the ALLOWED_ORIGINS environment variable.
For n8n integration, OAuth2 authentication is supported and configured via environment variables.
Submit general contact form inquiries.
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Contact name (2-100 chars) |
email |
string | Yes | Valid email address |
phone |
string | No | Phone number (optional) |
subject |
string | Yes | Subject line (3-200 chars) |
message |
string | Yes | Message content (10-5000 chars) |
company |
string | No | Company name (optional) |
consent |
boolean | Yes | Privacy policy consent (must be true) |
POST /api/forms/contact
Content-Type: application/json
{
"name": "John Doe",
"email": "john@example.com",
"subject": "Project Inquiry",
"message": "I'm interested in learning more about your services.",
"consent": true
}
{
"success": true,
"message": "Contact form submitted successfully",
"data": {
"referenceId": "CONTACT-1698765432000",
"debugId": "1698765432000-a1b2c3d4",
"submittedAt": "2025-10-26T10:30:32.000Z",
"processingTime": 245
}
}
{
"error": {
"message": "Validation failed",
"code": "VALIDATION_ERROR",
"status": 400,
"details": [
{
"field": "email",
"message": "Please provide a valid email address",
"type": "string.email"
}
]
}
}
3 requests per 15 minutes per email address
Submit business inquiry with comprehensive information.
| Field | Type | Required | Description |
|---|---|---|---|
name |
string | Yes | Contact name |
email |
string | Yes | Business email |
phone |
string | Yes | Contact phone |
businessName |
string | Yes | Company/business name |
businessType |
enum | Yes | sole-proprietorship, partnership, llc, corporation, non-profit, startup, enterprise, other |
websiteUrl |
string | No | Business website URL |
message |
string | Yes | Inquiry message (20-5000 chars) |
urgency |
enum | No | low, medium, high, urgent (default: medium) |
consent |
boolean | Yes | Must be true |
POST /api/forms/business-contact
Content-Type: application/json
{
"name": "Sarah Johnson",
"email": "sarah@techcorp.com",
"phone": "+1-555-0123",
"businessName": "Tech Corp",
"businessType": "corporation",
"websiteUrl": "https://techcorp.com",
"message": "Interested in partnership opportunities",
"urgency": "medium",
"consent": true
}
{
"success": true,
"message": "Business contact form submitted successfully",
"data": {
"referenceId": "BIZ-1698765432000",
"debugId": "1698765432000-a1b2c3d4",
"submittedAt": "2025-10-26T10:30:32.000Z",
"processingTime": 312,
"estimatedResponseTime": "24-48 hours"
}
}
2 requests per hour per email address
Check server health and status.
{
"status": "healthy",
"timestamp": "2025-10-26T10:30:32.000Z",
"environment": "production"
}
List all available API routes.
{
"message": "API Routes",
"version": "1.0.0",
"availableRoutes": [
"GET /api",
"GET /api/example",
"POST /api/forms/contact",
"POST /api/forms/business-contact",
"POST /api/forms/business-inquiry"
]
}
All errors follow this format:
{
"error": {
"message": "Error description",
"code": "ERROR_CODE",
"status": 400,
"debugId": "1698765432000-a1b2c3d4"
}
}
| Code | Status | Description |
|---|---|---|
VALIDATION_ERROR |
400 | Request validation failed |
RATE_LIMIT_EXCEEDED |
429 | Too many requests |
ROUTE_NOT_FOUND |
404 | Endpoint does not exist |
INTERNAL_ERROR |
500 | Server error (contact support with debugId) |
async function submitContactForm(formData) {
try {
const response = await fetch('https://your-backend.com/api/forms/contact', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(formData)
});
const result = await response.json();
if (response.ok) {
console.log('Success:', result.data.referenceId);
return result;
} else {
console.error('Error:', result.error.message);
throw new Error(result.error.message);
}
} catch (error) {
console.error('Network error:', error);
throw error;
}
}
curl -X POST https://your-backend.com/api/forms/contact \
-H "Content-Type: application/json" \
-d '{
"name": "John Doe",
"email": "john@example.com",
"subject": "Question",
"message": "Hello",
"consent": true
}'
const axios = require('axios');
async function submitForm(data) {
try {
const response = await axios.post(
'https://your-backend.com/api/forms/contact',
data,
{
headers: {
'Content-Type': 'application/json'
}
}
);
console.log('Submitted:', response.data.data.referenceId);
return response.data;
} catch (error) {
if (error.response) {
console.error('Error:', error.response.data.error.message);
} else {
console.error('Network error:', error.message);
}
throw error;
}
}