{"openapi":"3.1.0","info":{"title":"Diwash Bhandari Portfolio API","description":"Public API endpoint for sending messages to Diwash Bhandari, a Backend Engineer & AI Developer based in Kathmandu, Nepal. Specializing in FastAPI, scalable API architecture, RAG systems, and production-ready AI/ML integration.","version":"1.0.0","contact":{"name":"Diwash Bhandari","email":"dev@diwash-bhandari.com.np","url":"https://www.diwash-bhandari.com.np"},"license":{"name":"MIT","url":"https://github.com/Diwas2055"}},"servers":[{"url":"https://www.diwash-bhandari.com.np/api","description":"Production server"}],"paths":{"/contact":{"post":{"operationId":"sendContactMessage","summary":"Send a contact message","description":"Send a message to Diwash Bhandari. Ideal for project inquiries, collaboration proposals, or technical questions about backend development, AI/ML integration, or system architecture.","tags":["contact"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactRequest"},"examples":{"inquiry":{"summary":"Project inquiry","value":{"name":"Jane Doe","email":"jane@example.com","message":"Hi Diwash, I'd like to discuss a backend API project using FastAPI. Can we schedule a call?"}}}}}},"responses":{"200":{"description":"Message sent successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactSuccess"},"examples":{"default":{"value":{"success":true,"message":"Message sent successfully! I'll get back to you within 24-48 hours."}}}}},"headers":{"RateLimit-Limit":{"description":"Total rate limit allowed per window","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Remaining requests in current window","schema":{"type":"integer"}},"Vary":{"description":"Header field list for caching purposes","schema":{"type":"string"}}}},"400":{"description":"Bad request — validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"missingFields":{"value":{"error":"MISSING_FIELDS","message":"Missing required fields: name, email, message.","hint":"Include all three fields: name (string), email (string), message (string).","timestamp":"2026-08-23T12:00:00.000Z","path":"/api/contact"}},"invalidEmail":{"value":{"error":"INVALID_EMAIL","message":"Email address is not valid.","hint":"Provide a valid email address like name@example.com.","timestamp":"2026-08-23T12:00:00.000Z","path":"/api/contact"}}}}}},"429":{"description":"Rate limited — too many requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"examples":{"rateLimited":{"value":{"error":"RATE_LIMITED","message":"Too many requests. Please wait before retrying.","hint":"Retry after the rate limit window resets (60 seconds).","timestamp":"2026-08-23T12:00:00.000Z","path":"/api/contact"}}}}},"headers":{"Retry-After":{"description":"Seconds to wait before retrying","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Epoch timestamp when rate limit resets","schema":{"type":"integer"}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"502":{"description":"Bad gateway — downstream service (email provider) error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"operationId":"getContactInfo","summary":"Get contact API info","description":"Returns information about the contact endpoint, including accepted fields and description.","tags":["contact"],"responses":{"200":{"description":"Endpoint information","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"endpoint":{"type":"string","example":"/api/contact"},"method":{"type":"array","items":{"type":"string"},"example":["POST"]},"description":{"type":"string"},"schema":{"type":"object"}},"required":["success","endpoint","method","description","schema"]}}}}}}}},"components":{"schemas":{"ContactRequest":{"type":"object","description":"Request body for sending a contact message","required":["name","email","message"],"properties":{"name":{"type":"string","description":"Your full name","minLength":2,"maxLength":100,"example":"Jane Doe"},"email":{"type":"string","format":"email","description":"Your email address","pattern":"^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$","example":"jane@example.com"},"message":{"type":"string","description":"Your message — project details, questions, or collaboration proposal","minLength":10,"maxLength":2000,"example":"Hi Diwash, I'd like to discuss a backend API project using FastAPI."}},"additionalProperties":false},"ContactSuccess":{"type":"object","description":"Success response after sending a contact message","required":["success","message"],"properties":{"success":{"type":"boolean","description":"Always true on success","example":true},"message":{"type":"string","description":"Human-readable success message","example":"Message sent successfully! I'll get back to you within 24-48 hours."}}},"ErrorResponse":{"type":"object","description":"Structured error response","required":["error","message","hint","timestamp","path"],"properties":{"error":{"type":"string","description":"Machine-readable error code","example":"INVALID_EMAIL"},"message":{"type":"string","description":"Human-readable error message","example":"Email address is not valid."},"hint":{"type":"string","description":"Resolution hint for the caller","example":"Provide a valid email address like name@example.com."},"timestamp":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of the error","example":"2026-08-23T12:00:00.000Z"},"path":{"type":"string","description":"API path that returned the error","example":"/api/contact"}},"additionalProperties":false}},"securitySchemes":{}},"security":[],"tags":[{"name":"contact","description":"Send messages and get endpoint info for the contact form"}]}