{"openapi":"3.1.0","info":{"title":"stub.page","version":"0.1.0","description":"Publish text posts without an account. Creating a post returns an edit_key that is shown exactly once and cannot be recovered. Without it the post can never be edited or deleted again."},"servers":[{"url":"https://stub.page"}],"components":{"securitySchemes":{"editKey":{"type":"http","scheme":"bearer","description":"The edit_key returned by POST /api/pages. Only accepted in the Authorization header — never as a query parameter."}},"schemas":{"Page":{"type":"object","properties":{"slug":{"type":"string","example":"my-first-post-a7f3k2"},"url":{"type":"string","format":"uri"},"title":{"type":"string","nullable":true},"content":{"type":"string","description":"Markdown source"},"content_html":{"type":"string","description":"Rendered and sanitized HTML"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["slug","url","content","content_html","created_at","updated_at"]},"Error":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}},"paths":{"/api/pages":{"post":{"summary":"Create a page","description":"The response is the only time the edit key is returned in clear text.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200,"description":"The URL is derived from the title and never changes afterwards."},"content":{"type":"string","minLength":1,"description":"Markdown, at most 102400 bytes."}},"required":["title","content"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string"},"url":{"type":"string","format":"uri"},"edit_key":{"type":"string","description":"Shown exactly once. Not recoverable."},"created_at":{"type":"string","format":"date-time"}},"required":["slug","url","edit_key","created_at"]}}}},"400":{"description":"Empty content or invalid body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Content too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}}},"/api/pages/{slug}":{"get":{"summary":"Read a page","description":"Public — no edit key required.","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"The slug from the page URL."}],"responses":{"200":{"description":"The page","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","example":"my-first-post-a7f3k2"},"url":{"type":"string","format":"uri"},"title":{"type":"string","nullable":true},"content":{"type":"string","description":"Markdown source"},"content_html":{"type":"string","description":"Rendered and sanitized HTML"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["slug","url","content","content_html","created_at","updated_at"]}}}},"404":{"description":"No such page","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Page was deleted","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}},"patch":{"summary":"Update a page","description":"Omitted fields keep their current value. The slug never changes.","security":[{"editKey":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"The slug from the page URL."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":200,"nullable":true},"content":{"type":"string"}}}}}},"responses":{"200":{"description":"The updated page","content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","example":"my-first-post-a7f3k2"},"url":{"type":"string","format":"uri"},"title":{"type":"string","nullable":true},"content":{"type":"string","description":"Markdown source"},"content_html":{"type":"string","description":"Rendered and sanitized HTML"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["slug","url","content","content_html","created_at","updated_at"]}}}},"400":{"description":"Invalid body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Missing or invalid edit key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such page","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Page was deleted","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Content too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}},"delete":{"summary":"Delete a page","description":"Permanent. The slug is never reused.","security":[{"editKey":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"The slug from the page URL."}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Missing or invalid edit key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No such page","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"410":{"description":"Page was deleted","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"}},"required":["error"]}}}}}}}}}