Contact Form API
Public endpoint for submitting the contact form on the landing page. No authentication required.
Endpoint
POST
https://eggisatria.dev/api/contact
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | yes | 2–100 chars |
email | string | yes | Valid email, ≤ 200 chars |
message | string | yes | 10–2000 chars |
source | string | no | Attribution tag, e.g. "landing", "blog". Defaults to "landing". |
Example request
Terminal
curl -X POST https://eggisatria.dev/api/contact \
-H "Content-Type: application/json" \
-d '{
"name": "Ada Lovelace",
"email": "ada@example.com",
"message": "Hi! I'd love to chat about a project.",
"source": "docs"
}'Example response
JSON · 201 Created
{
"success": true,
"data": {
"id": "ckxxx...",
"message": "Thanks! Your message has been received — I'll get back to you soon."
},
"error": null
}Side effects
- The submission is persisted to the
contact_submissionstable and visible in the Manager dashboard at/dashboard/contact. - If
RESEND_API_KEYis set, a notification email is sent to the site owner. Otherwise the email is logged to the server console. - Rate-limited per IP: 5 submissions per 10 minutes.
Error responses
| Status | Cause |
|---|---|
400 | Invalid JSON, missing fields, or fields outside the allowed ranges. |
429 | Rate limit exceeded. |
500 | Database failure. Retry the request. |