Developer reference
API.
A small HTTP API behind this portfolio. Machine-readable description: openapi.json · catalog: /.well-known/api-catalog
POST /api/contact
Delivers the contact form. Accepts JSON or form-encoded bodies.
- name
- string, required, max 120
- string, required, max 254 — used as the reply-to address
- subject
- string, optional, max 160 — used as the subject of the delivered mail
- company
- string, optional, max 160
- message
- string, required, max 5000
- website
- honeypot — leave empty. A non-empty value is treated as a bot and discarded, with a 200 so the bot learns nothing.
curl -X POST https://www.pradeepmaury.in/api/contact \
-H 'Content-Type: application/json' \
-d '{"name":"Jane","email":"jane@example.com","message":"Hello"}'
Returns {"ok":true} on success.
400 with an error code on validation failure, 502 if
the mail provider rejects it, 503 if sending is not configured.
GET /api/health
Liveness and configuration status —
the status relation in the API catalog.
{"status":"ok","contact":"ready","time":"…"}
contact reports unconfigured when the
mail key is missing, so a monitor sees a misconfigured deploy rather than a
false green.
Error codes
- company_too_longCompany exceeds 160 characters.
- email_invalidEmail is not a valid address.
- email_requiredEmail was empty.
- email_too_longEmail exceeds 254 characters.
- message_requiredMessage was empty.
- message_too_longMessage exceeds 5000 characters.
- name_requiredName was empty.
- name_too_longName exceeds 120 characters.
- subject_too_longSubject exceeds 160 characters.