{"openapi":"3.1.0","info":{"title":"Portfolio API","description":"Backend API for portfolio website","version":"1.0.0"},"paths":{"/api/posts":{"get":{"summary":"Get All Posts","operationId":"get_all_posts_api_posts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/BlogPost"},"type":"array","title":"Response Get All Posts Api Posts Get"}}}}}},"post":{"summary":"Create Post","operationId":"create_post_api_posts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogPostIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogPost"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/posts/{slug}":{"get":{"summary":"Get Post By Slug","operationId":"get_post_by_slug_api_posts__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogPost"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"summary":"Update Post","operationId":"update_post_api_posts__slug__put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogPostIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogPost"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Post","operationId":"delete_post_api_posts__slug__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/posts":{"get":{"summary":"Get All Posts Admin","operationId":"get_all_posts_admin_api_admin_posts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/BlogPost"},"type":"array","title":"Response Get All Posts Admin Api Admin Posts Get"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/admin/posts/{slug}":{"get":{"summary":"Get Post By Slug Admin","operationId":"get_post_by_slug_admin_api_admin_posts__slug__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogPost"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/blog/{slug}":{"get":{"summary":"Get Public Post","operationId":"get_public_post_api_blog__slug__get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlogPost"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/blog":{"get":{"summary":"Blog Alias","operationId":"blog_alias_api_blog_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/BlogPost"},"type":"array","title":"Response Blog Alias Api Blog Get"}}}}}}},"/api/admin/update-weights":{"post":{"summary":"Update Post Weights","operationId":"update_post_weights_api_admin_update_weights_post","requestBody":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WeightUpdate"},"type":"array","title":"Weights"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/categories":{"get":{"summary":"Get Grouped Categories","operationId":"get_grouped_categories_api_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"items":{"$ref":"#/components/schemas/Category"},"type":"array"},"type":"object","title":"Response Get Grouped Categories Api Categories Get"}}}}}}},"/api/upload-url":{"post":{"summary":"Get Upload Url","description":"Generate a presigned URL for uploading to S3.\nRequires valid JWT token.","operationId":"get_upload_url_api_upload_url_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/cv":{"get":{"summary":"Get Current Cv","description":"Return public metadata for the current CV.\nThe file itself is served through /api/cv/download so the public URL stays stable.","operationId":"get_current_cv_api_cv_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Publish Cv","description":"Mark a retained S3 PDF as the current public CV.","operationId":"publish_cv_api_cv_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CvPublishRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/cv/download":{"get":{"summary":"Download Current Cv","description":"Stable public CV URL. Redirects to a signed URL for the current retained S3 version.","operationId":"download_current_cv_api_cv_download_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/cv/versions":{"get":{"summary":"List Cv Versions","operationId":"list_cv_versions_api_admin_cv_versions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/cv/upload-url":{"post":{"summary":"Get Cv Upload Url","description":"Generate a presigned URL for a PDF CV upload.","operationId":"get_cv_upload_url_api_cv_upload_url_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CvUploadUrlRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/images":{"get":{"summary":"Get Uploaded Images","description":"List all uploaded images in S3 uploads/ directory.\nRequires valid JWT token.","operationId":"get_uploaded_images_api_images_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/images/{key}":{"delete":{"summary":"Delete Uploaded Image","description":"Delete an image from S3 uploads/ directory by key.\nRequires valid JWT token.","operationId":"delete_uploaded_image_api_images__key__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/settings/cv-links":{"get":{"summary":"Get Public Cv Links Setting","operationId":"get_public_cv_links_setting_api_settings_cv_links_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/settings/cv-links":{"get":{"summary":"Get Admin Cv Links Setting","operationId":"get_admin_cv_links_setting_api_admin_settings_cv_links_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"patch":{"summary":"Update Admin Cv Links Setting","operationId":"update_admin_cv_links_setting_api_admin_settings_cv_links_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CvLinksSettingUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/contact":{"post":{"summary":"Submit Contact","description":"Handle a contact form submission: persist it, notify the owner, acknowledge\nto the sender.","operationId":"submit_contact_api_contact_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactSubmissionIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/contact-submissions":{"get":{"summary":"List Contact Submissions","description":"Newest first. Admin only.","operationId":"list_contact_submissions_api_admin_contact_submissions_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ContactSubmissionOut"},"title":"Response List Contact Submissions Api Admin Contact Submissions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/login":{"post":{"summary":"Login","description":"Admin login. Issues JWT on correct credentials.","operationId":"login_api_login_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login_api_login_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/healthz":{"get":{"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/session":{"get":{"summary":"Admin Session","description":"Validate the current admin JWT without loading protected business data.","operationId":"admin_session_api_admin_session_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}}},"components":{"schemas":{"BlogPost":{"properties":{"title":{"type":"string","title":"Title","example":"Understanding FastAPI"},"slug":{"type":"string","title":"Slug","example":"understanding-fastapi"},"summary":{"type":"string","title":"Summary","example":"Intro to FastAPI with examples."},"content":{"$ref":"#/components/schemas/Content","example":{"html":"<p>This is the full article...</p>"}},"status":{"type":"string","enum":["draft","published"],"title":"Status","default":"draft"},"categories":{"items":{"type":"string"},"type":"array","title":"Categories","default":[],"example":["Python","Backend"]},"date":{"type":"string","format":"date-time","title":"Date"},"date_created":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date Created"},"date_published":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date Published"},"date_updated":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date Updated"},"featuredImage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Featuredimage","default":"","example":"https://example.com/image.jpg"},"featured":{"type":"boolean","title":"Featured","default":false},"weight":{"type":"integer","title":"Weight","default":0}},"type":"object","required":["title","slug","summary","content"],"title":"BlogPost","description":"Full representation of a blog post, including internal metadata."},"BlogPostIn":{"properties":{"title":{"type":"string","title":"Title"},"slug":{"type":"string","title":"Slug"},"summary":{"type":"string","title":"Summary"},"content":{"$ref":"#/components/schemas/Content"},"status":{"type":"string","enum":["draft","published"],"title":"Status","default":"draft"},"categories":{"items":{"type":"string"},"type":"array","title":"Categories","default":[]},"date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date"},"date_created":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date Created"},"date_published":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date Published"},"date_updated":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date Updated"},"featuredImage":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Featuredimage","default":""},"featured":{"type":"boolean","title":"Featured","default":false},"weight":{"type":"integer","title":"Weight","default":0}},"type":"object","required":["title","slug","summary","content"],"title":"BlogPostIn","description":"Input schema for creating or updating blog posts (admin only)."},"Body_login_api_login_post":{"properties":{"grant_type":{"anyOf":[{"type":"string","pattern":"^password$"},{"type":"null"}],"title":"Grant Type"},"username":{"type":"string","title":"Username"},"password":{"type":"string","format":"password","title":"Password"},"scope":{"type":"string","title":"Scope","default":""},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"format":"password","title":"Client Secret"}},"type":"object","required":["username","password"],"title":"Body_login_api_login_post"},"Category":{"properties":{"name":{"type":"string","title":"Name","example":"Python"},"group":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group","default":"Other","example":"Tech"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label","example":"Python (Tech)"}},"type":"object","required":["name"],"title":"Category"},"ContactSubmissionIn":{"properties":{"name":{"type":"string","title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"message":{"type":"string","title":"Message"},"website":{"type":"string","title":"Website","default":""}},"type":"object","required":["name","email","message"],"title":"ContactSubmissionIn"},"ContactSubmissionOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"message":{"type":"string","title":"Message"},"submitted_at":{"type":"string","format":"date-time","title":"Submitted At"},"notification_status":{"type":"string","enum":["pending","sent","failed"],"title":"Notification Status"},"acknowledgement_status":{"type":"string","enum":["pending","sent","failed"],"title":"Acknowledgement Status"}},"type":"object","required":["id","name","email","message","submitted_at","notification_status","acknowledgement_status"],"title":"ContactSubmissionOut","description":"Admin-facing view.\n\n`client_ip` is deliberately absent: the admin list exists to read messages,\nnot to profile the people who sent them, and the value stays in the\ndocument for abuse triage rather than being rendered in a browser."},"Content":{"properties":{"html":{"type":"string","title":"Html"}},"type":"object","required":["html"],"title":"Content"},"CvLinksSettingUpdate":{"properties":{"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["enabled"],"title":"CvLinksSettingUpdate"},"CvPublishRequest":{"properties":{"filename":{"type":"string","title":"Filename"},"content_type":{"type":"string","const":"application/pdf","title":"Content Type"},"size":{"type":"integer","title":"Size"},"key":{"type":"string","title":"Key"},"file_url":{"type":"string","title":"File Url"},"phone_number_confirmed_absent":{"type":"boolean","title":"Phone Number Confirmed Absent"}},"type":"object","required":["filename","content_type","size","key","file_url","phone_number_confirmed_absent"],"title":"CvPublishRequest"},"CvUploadUrlRequest":{"properties":{"filename":{"type":"string","title":"Filename"},"content_type":{"type":"string","title":"Content Type"},"size":{"type":"integer","title":"Size"}},"type":"object","required":["filename","content_type","size"],"title":"CvUploadUrlRequest"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type"}},"type":"object","required":["access_token","token_type"],"title":"Token"},"UploadRequest":{"properties":{"filename":{"type":"string","title":"Filename"},"content_type":{"type":"string","title":"Content Type"}},"type":"object","required":["filename","content_type"],"title":"UploadRequest"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WeightUpdate":{"properties":{"slug":{"type":"string","title":"Slug"},"weight":{"type":"integer","title":"Weight"}},"type":"object","required":["slug","weight"],"title":"WeightUpdate"}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/login"}}}}}}