{"openapi":"3.1.0","info":{"title":"keel API","version":"0.0.0","description":"Base-tier worker API. Auth is enforced by Cloudflare Access in front of this worker."},"components":{"schemas":{"PostSummary":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"week_of":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["draft","published"]},"latest_version":{"type":"integer"},"published_version":{"type":["integer","null"]},"published_at":{"type":["string","null"],"format":"date-time"},"scheduled_publish_at":{"type":["string","null"],"format":"date-time"},"scheduled_version":{"type":["integer","null"]},"updated_at":{"type":"string","format":"date-time"}},"required":["id","slug","week_of","title","status","latest_version","published_version","published_at","scheduled_publish_at","scheduled_version","updated_at"]},"ErrorResponse":{"type":"object","properties":{"code":{"type":"string","example":"post.not_found"},"message":{"type":"string"},"field":{"type":"string"}},"required":["code","message"]},"ValidationError":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"message":{"type":"string"}},"required":["path","message"]}}},"required":["code","message","errors"]},"PostListItem":{"allOf":[{"$ref":"#/components/schemas/PostSummary"},{"type":"object","properties":{"last_saved_by":{"type":"string"},"last_saved_at":{"type":"string","format":"date-time"},"open_comments":{"type":"integer"},"approved_version":{"type":["object","null"],"properties":{"number":{"type":"integer"},"by":{"type":"array","items":{"type":"string"}}},"required":["number","by"]}},"required":["last_saved_by","last_saved_at","open_comments","approved_version"]}]},"PostState":{"type":"object","properties":{"post":{"$ref":"#/components/schemas/PostSummary"},"document":{"$ref":"#/components/schemas/PostDocument"}},"required":["post","document"]},"PostDocument":{"type":"object","additionalProperties":{},"description":"The post document (docs/authoring.md)."},"PostVersionSummary":{"type":"object","properties":{"number":{"type":"integer"},"saved_by_name":{"type":"string"},"saved_at":{"type":"string","format":"date-time"},"sanitizer_version":{"type":"integer"},"viewable":{"type":"boolean"}},"required":["number","saved_by_name","saved_at","sanitizer_version","viewable"]},"PostVersion":{"allOf":[{"$ref":"#/components/schemas/PostVersionSummary"},{"type":"object","properties":{"document":{"$ref":"#/components/schemas/PostDocument"}},"required":["document"]}]},"PostPage":{"type":"object","properties":{"slug":{"type":"string"},"weekOf":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":["string","null"]},"description":{"type":"string"},"hideTitleBlock":{"type":"boolean"},"hero":{"type":["object","null"],"properties":{"videoUrl":{"type":"string"},"posterUrl":{"type":["string","null"]},"label":{"type":["string","null"]},"captionLead":{"type":["string","null"]},"caption":{"type":["string","null"]}},"required":["videoUrl","posterUrl","label","captionLead","caption"]},"authors":{"type":"array","items":{"$ref":"#/components/schemas/PageAuthor"}},"blocks":{"type":"array","items":{"$ref":"#/components/schemas/PageBlock"}},"site":{"type":"object","properties":{"name":{"type":"string"},"eyebrow":{"type":"string"}},"required":["name","eyebrow"]},"footerNotice":{"type":["string","null"]},"chrome":{"type":"object","properties":{"header":{"type":"string"},"footer":{"type":"string"}},"required":["header","footer"]}},"required":["slug","weekOf","title","subtitle","description","hideTitleBlock","hero","authors","blocks","site","footerNotice","chrome"]},"PageAuthor":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"initials":{"type":"string"},"title":{"type":"string"},"email":{"type":["string","null"]},"ask":{"type":["string","null"]},"bio":{"type":["string","null"]},"photoUrl":{"type":["string","null"]},"organisation":{"type":["string","null"]}},"required":["slug","name","initials","title","email","ask","bio","photoUrl","organisation"]},"PageBlock":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["html"]},"html":{"type":"string"}},"required":["type","html"]},{"type":"object","properties":{"type":{"type":"string","enum":["author_cards"]}},"required":["type"]}]},"SavedPost":{"allOf":[{"$ref":"#/components/schemas/PostState"},{"type":"object","properties":{"version":{"type":"integer"},"removed":{"type":"array","items":{"$ref":"#/components/schemas/SanitizerRemoval"}},"preview_path":{"type":"string"}},"required":["version","removed","preview_path"]}]},"SanitizerRemoval":{"type":"object","properties":{"path":{"type":"string"},"kind":{"type":"string","enum":["element","attribute","url"]},"name":{"type":"string"},"detail":{"type":"string"}},"required":["path","kind","name"]},"StaleSave":{"type":"object","properties":{"code":{"type":"string","enum":["post.stale"]},"message":{"type":"string"},"latest_version":{"type":"integer"}},"required":["code","message","latest_version"]},"EmailHandoff":{"type":"object","properties":{"send_id":{"type":"string"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"recipients":{"type":"array","items":{"type":"string"}},"from_note":{"type":"string"},"reply_to":{"type":["string","null"]}},"required":["send_id","subject","html","text","recipients","from_note","reply_to"]},"EmailSend":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["test","list"]},"version":{"type":"integer"},"subject":{"type":"string"},"transport":{"type":"string"},"tracking":{"type":"string","enum":["first-party","sink","none"]},"sent_by_name":{"type":"string"},"reply_to":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"recipient_count":{"type":"integer"},"sent":{"type":"integer"},"failed":{"type":"integer"},"pending":{"type":"integer"},"prepared":{"type":"integer"},"cancelled":{"type":"integer"},"recipients":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"status":{"type":"string","enum":["pending","prepared","sent","failed","cancelled"]},"error":{"type":["string","null"]}},"required":["email","status","error"]}},"links":{"type":"array","items":{"type":"object","properties":{"position":{"type":"integer"},"url":{"type":"string"},"label":{"type":"string"},"clicks":{"type":"integer"},"clicks_refreshed_at":{"type":["string","null"],"format":"date-time"}},"required":["position","url","label","clicks","clicks_refreshed_at"]}}},"required":["id","kind","version","subject","transport","tracking","sent_by_name","reply_to","created_at","recipient_count","sent","failed","pending","prepared","cancelled","recipients","links"]},"DraftRender":{"type":"object","properties":{"page":{"$ref":"#/components/schemas/PostPage"},"email_html":{"type":"string"},"email_text":{"type":"string"}},"required":["page","email_html","email_text"]},"EmailPreview":{"type":"object","properties":{"post_id":{"type":"string"},"version":{"type":"integer"},"published":{"type":"boolean"},"settings":{"$ref":"#/components/schemas/EmailSettings"},"subject":{"type":"string"},"html":{"type":"string"},"text":{"type":"string"},"hero":{"$ref":"#/components/schemas/Media"},"warnings":{"type":"array","items":{"type":"string"}},"delivery":{"type":"object","properties":{"enabled":{"type":"boolean"},"disabled_reason":{"type":["string","null"]},"transport":{"type":["string","null"]},"from":{"type":["string","null"]}},"required":["enabled","disabled_reason","transport","from"]},"send_blocked":{"type":["string","null"]},"handoff_blocked":{"type":["string","null"]},"active_recipients":{"type":"integer"},"reply_to":{"type":["string","null"]},"test_to":{"type":["string","null"]},"sends":{"type":"array","items":{"$ref":"#/components/schemas/EmailSend"}},"classic_outlook_html":{"type":"string","description":"Simulation of classic Outlook with pictures off: images as boxes with their descriptions, square corners, Arial. Not a rendering by Outlook."},"classic_outlook_html_pictures_on":{"type":"string","description":"Simulation of classic Outlook with pictures on: images shown, square corners, Arial. Not a rendering by Outlook."}},"required":["post_id","version","published","settings","subject","html","text","hero","warnings","delivery","send_blocked","handoff_blocked","active_recipients","reply_to","sends"]},"EmailSettings":{"type":"object","properties":{"subject":{"type":["string","null"]},"preheader":{"type":["string","null"]},"hero_image":{"type":["string","null"]}},"required":["subject","preheader","hero_image"]},"Media":{"type":["object","null"],"properties":{"key":{"type":"string"},"path":{"type":"string"},"content_type":{"type":"string"},"size":{"type":"integer"},"sha256":{"type":"string"}},"required":["key","path","content_type","size","sha256"]},"ReviewSummary":{"type":"object","properties":{"post_id":{"type":"string"},"state":{"type":"string","enum":["draft","in_review","approved"]},"latest_version":{"type":"integer"},"verdicts":{"type":"array","items":{"$ref":"#/components/schemas/ReviewVerdict"}},"approved_version":{"type":["object","null"],"properties":{"number":{"type":"integer"},"by":{"type":"array","items":{"type":"string"}}},"required":["number","by"]},"open_threads":{"type":"integer"},"open_suggestions":{"type":"integer"}},"required":["post_id","state","latest_version","verdicts","approved_version","open_threads","open_suggestions"]},"ReviewVerdict":{"type":"object","properties":{"by":{"type":"string"},"verdict":{"type":"string","enum":["approve","request_changes"]},"at":{"type":"string","format":"date-time"}},"required":["by","verdict","at"]},"ReviewPage":{"type":"object","properties":{"post":{"$ref":"#/components/schemas/PostSummary"},"version":{"type":"integer"},"document":{"$ref":"#/components/schemas/PostDocument"},"page":{"$ref":"#/components/schemas/PostPage"},"review":{"$ref":"#/components/schemas/ReviewSummary"},"threads":{"type":"array","items":{"$ref":"#/components/schemas/ReviewThread"}}},"required":["post","version","document","page","review","threads"]},"ReviewThread":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["comment","suggestion"]},"status":{"type":"string","enum":["open","resolved","accepted","dismissed"]},"created_version":{"type":"integer"},"anchor":{"$ref":"#/components/schemas/ReviewAnchor"},"replacement":{"type":["string","null"]},"applied_version":{"type":["integer","null"]},"by":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"closed_by":{"type":["string","null"]},"closed_at":{"type":["string","null"],"format":"date-time"},"location":{"$ref":"#/components/schemas/AnchorLocation"},"item":{"type":["string","null"]},"quote":{"type":["string","null"]},"anchor_status":{"type":"string","enum":["located","moved","orphaned"]},"comments":{"type":"array","items":{"$ref":"#/components/schemas/ReviewComment"}}},"required":["id","kind","status","created_version","anchor","replacement","applied_version","by","created_at","closed_by","closed_at","location","item","quote","anchor_status","comments"]},"ReviewAnchor":{"type":["object","null"],"properties":{"item":{"type":"string"},"quote":{"$ref":"#/components/schemas/TextQuote"}},"description":"Omit for the whole post; `item` alone for an element; `quote` (usually with the `item` it starts in) for a passage."},"TextQuote":{"type":"object","properties":{"text":{"type":"string"},"prefix":{"type":"string"},"suffix":{"type":"string"}},"required":["text"],"description":"A text-quote selector: the passage and up to 32 characters around it."},"AnchorLocation":{"type":"object","properties":{"version":{"type":"integer"},"status":{"type":"string","enum":["located","moved","orphaned"]},"item":{"type":"string"},"text":{"type":"string"}},"required":["version","status"]},"ReviewComment":{"type":"object","properties":{"id":{"type":"string"},"by":{"type":"string"},"body":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"required":["id","by","body","created_at"]},"ReviewThreads":{"type":"object","properties":{"version":{"type":"integer"},"threads":{"type":"array","items":{"$ref":"#/components/schemas/ReviewThread"}}},"required":["version","threads"]},"ReviewConflict":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"latest_version":{"type":"integer"},"outdated":{"type":"boolean"}},"required":["code","message"]},"AcceptedSuggestion":{"allOf":[{"$ref":"#/components/schemas/SavedPost"},{"type":"object","properties":{"thread":{"$ref":"#/components/schemas/ReviewThread"}},"required":["thread"]}]},"PostStats":{"type":"object","properties":{"post_id":{"type":"string"},"totals":{"type":"object","properties":{"views":{"type":"integer"},"plays":{"type":"integer"},"clicks":{"type":"integer"}},"required":["views","plays","clicks"]},"days":{"type":"array","items":{"type":"object","properties":{"views":{"type":"integer"},"plays":{"type":"integer"},"clicks":{"type":"integer"},"day":{"type":"string"}},"required":["views","plays","clicks","day"]}},"sends":{"type":"array","items":{"$ref":"#/components/schemas/EmailSend"}},"sink_stats_unavailable":{"type":"boolean"}},"required":["post_id","totals","days","sends","sink_stats_unavailable"]},"StatsSummary":{"type":"object","properties":{"home":{"type":"object","properties":{"views":{"type":"integer"},"plays":{"type":"integer"},"clicks":{"type":"integer"}},"required":["views","plays","clicks"]},"posts":{"type":"array","items":{"type":"object","properties":{"post_id":{"type":"string"},"totals":{"type":"object","properties":{"views":{"type":"integer"},"plays":{"type":"integer"},"clicks":{"type":"integer"}},"required":["views","plays","clicks"]}},"required":["post_id","totals"]}}},"required":["home","posts"]},"HealthReport":{"type":"object","properties":{"status":{"type":"string","enum":["ok","degraded","down"],"description":"Worst status across all dependency checks."},"checks":{"type":"array","items":{"$ref":"#/components/schemas/HealthCheck"}},"checkedAt":{"type":"string","format":"date-time","example":"2026-01-02T03:04:05.000Z"}},"required":["status","checks","checkedAt"]},"HealthCheck":{"type":"object","properties":{"name":{"type":"string","example":"database"},"status":{"type":"string","enum":["ok","degraded","down"],"description":"Worst status across all dependency checks."},"detail":{"type":"string","description":"Coarse failure label. Never carries a driver message or a stack."},"durationMs":{"type":"number","minimum":0}},"required":["name","status"]},"Recipient":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"}},"required":["id","email","name","active","created_at"]},"OutboxMessage":{"type":"object","properties":{"id":{"type":"string"},"send_id":{"type":"string"},"to":{"type":"string"},"from":{"type":"string"},"reply_to":{"type":["string","null"]},"subject":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"created_at":{"type":"string","format":"date-time"},"html":{"type":"string"},"text":{"type":"string"}},"required":["id","send_id","to","from","reply_to","subject","headers","created_at","html","text"]},"Author":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"title":{"type":["string","null"]},"email":{"type":["string","null"]},"ask":{"type":["string","null"]},"bio":{"type":["string","null"]},"photo":{"type":["string","null"]},"organisation":{"type":["string","null"]}},"required":["slug","name","title","email","ask","bio","photo","organisation"]},"Template":{"type":"object","properties":{"name":{"type":"string"},"output":{"type":"string","enum":["email","text","web"]},"summary":{"type":"string"},"source":{"type":"string"},"defaultSource":{"type":"string"},"edited":{"type":"boolean"},"updatedBy":{"type":["string","null"]},"updatedAt":{"type":["string","null"]}},"required":["name","output","summary","source","defaultSource","edited","updatedBy","updatedAt"]},"TemplatePreview":{"type":"object","properties":{"post":{"type":["object","null"],"properties":{"id":{"type":"string"},"title":{"type":"string"}},"required":["id","title"]},"html":{"type":"string"},"text":{"type":"string"},"page":{"type":["object","null"],"properties":{"slug":{"type":"string"},"weekOf":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":["string","null"]},"description":{"type":"string"},"hideTitleBlock":{"type":"boolean"},"hero":{"type":["object","null"],"properties":{"videoUrl":{"type":"string"},"posterUrl":{"type":["string","null"]},"label":{"type":["string","null"]},"captionLead":{"type":["string","null"]},"caption":{"type":["string","null"]}},"required":["videoUrl","posterUrl","label","captionLead","caption"]},"authors":{"type":"array","items":{"$ref":"#/components/schemas/PageAuthor"}},"blocks":{"type":"array","items":{"$ref":"#/components/schemas/PageBlock"}},"site":{"type":"object","properties":{"name":{"type":"string"},"eyebrow":{"type":"string"}},"required":["name","eyebrow"]},"chrome":{"type":"object","properties":{"header":{"type":"string"},"footer":{"type":"string"}},"required":["header","footer"]}},"required":["slug","weekOf","title","subtitle","description","hideTitleBlock","hero","authors","blocks","site","chrome"]}},"required":["post","html","text","page"]},"SiteSettings":{"type":"object","properties":{"stored":{"type":"object","properties":{"sender_name":{"type":["string","null"]},"reply_mode":{"type":"string","enum":["sender","fixed"]},"reply_address":{"type":["string","null"]},"footer_line":{"type":["string","null"]},"byline_org":{"type":["string","null"]},"site_name":{"type":["string","null"]},"eyebrow_label":{"type":["string","null"]},"default_author_title":{"type":["string","null"]}},"required":["sender_name","reply_mode","reply_address","footer_line","byline_org","site_name","eyebrow_label","default_author_title"]},"effective":{"type":"object","properties":{"sender_name":{"type":"string"},"reply_address":{"type":["string","null"]},"footer_line":{"type":["string","null"]},"byline_org":{"type":["string","null"]},"site_name":{"type":"string"},"eyebrow_label":{"type":"string"},"default_author_title":{"type":"string"}},"required":["sender_name","reply_address","footer_line","byline_org","site_name","eyebrow_label","default_author_title"]},"deploy":{"type":"object","properties":{"sender_address":{"type":["string","null"]},"site_url":{"type":["string","null"]},"reply_to":{"type":["string","null"]}},"required":["sender_address","site_url","reply_to"]},"updated_by_name":{"type":["string","null"]},"updated_at":{"type":["string","null"],"format":"date-time"}},"required":["stored","effective","deploy","updated_by_name","updated_at"]},"SiteSettingsInput":{"type":"object","properties":{"sender_name":{"type":"string","maxLength":400,"description":"Blank: EMAIL_FROM_NAME, else the default."},"reply_mode":{"type":"string","enum":["sender","fixed"],"description":"`sender`: the person sending; `fixed`: `reply_address`."},"reply_address":{"type":["string","null"],"maxLength":1278,"description":"One or more addresses, comma-separated (at most 5). Blank or null: EMAIL_REPLY_TO, else the post authors."},"footer_line":{"type":"string","maxLength":400,"description":"The email’s last line; blank for none."},"byline_org":{"type":"string","maxLength":400,"description":"\"By <name>, <organisation>\" for authors without their own; blank for none."},"site_name":{"type":"string","maxLength":400},"eyebrow_label":{"type":"string","maxLength":400},"default_author_title":{"type":"string","maxLength":400}},"required":["sender_name","reply_mode","reply_address","footer_line","byline_org","site_name","eyebrow_label","default_author_title"]},"HomePage":{"type":"object","properties":{"latest":{"type":["object","null"],"properties":{"slug":{"type":"string"},"weekOf":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":["string","null"]},"description":{"type":"string"},"posterUrl":{"type":["string","null"]},"hasVideo":{"type":"boolean"},"companies":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"summary":{"type":"string"}},"required":["name","summary"]}}},"required":["slug","weekOf","title","subtitle","description","posterUrl","hasVideo","companies"]},"earlier":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"weekOf":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":["string","null"]},"description":{"type":"string"},"posterUrl":{"type":["string","null"]},"hasVideo":{"type":"boolean"},"companies":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"summary":{"type":"string"}},"required":["name","summary"]}}},"required":["slug","weekOf","title","subtitle","description","posterUrl","hasVideo","companies"]}},"site":{"type":"object","properties":{"name":{"type":"string"},"eyebrow":{"type":"string"}},"required":["name","eyebrow"]},"footerNotice":{"type":["string","null"]}},"required":["latest","earlier","site","footerNotice"]},"TelemetryIngestResponse":{"type":"object","properties":{"accepted":{"type":"integer","minimum":0}},"required":["accepted"]},"TelemetryIngestRequest":{"type":"object","properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/ClientTelemetryEvent"},"minItems":1,"maxItems":50}},"required":["events"]},"ClientTelemetryEvent":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"example":"browser.error"},"level":{"type":"string","enum":["debug","info","warn","error"]},"attributes":{"type":"object","additionalProperties":{"anyOf":[{"type":"string","maxLength":512},{"type":"number"},{"type":"boolean"},{"type":"null"}]}}},"required":["name"]},"UploadedMedia":{"allOf":[{"$ref":"#/components/schemas/Media"},{"type":"object","properties":{"existing":{"type":"boolean"},"email_copy":{"type":["string","null"]},"email_note":{"type":["string","null"]}},"required":["existing","email_copy","email_note"]}]},"EmailCopyBackfillRow":{"type":"object","properties":{"path":{"type":"string"},"result":{"type":"string","enum":["none","copied","skipped","kept-original","unlinked"]},"email_copy":{"type":["string","null"]},"reason":{"type":["string","null"]}},"required":["path","result","email_copy","reason"]}},"parameters":{}},"paths":{"/admin/api/posts/{id}/publish":{"post":{"operationId":"publishPost","tags":["posts"],"summary":"Publish a version now, or at `at` (an ISO-8601 instant with offset, in the future); admin only; the latest when version is absent","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"integer","minimum":1},"at":{"type":"string"}}}}}},"responses":{"200":{"description":"The post.","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"$ref":"#/components/schemas/PostSummary"}},"required":["post"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/schedule":{"delete":{"operationId":"cancelScheduledPublish","tags":["posts"],"summary":"Cancel a scheduled publish (admin only); what readers see is unchanged","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The post.","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"$ref":"#/components/schemas/PostSummary"}},"required":["post"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/unpublish":{"post":{"operationId":"unpublishPost","tags":["posts"],"summary":"Back to draft (admin only): its address answers 404 and it leaves the home page","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The post.","content":{"application/json":{"schema":{"type":"object","properties":{"post":{"$ref":"#/components/schemas/PostSummary"}},"required":["post"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts":{"get":{"operationId":"listPosts","tags":["posts"],"summary":"Every post with its status and versions","responses":{"200":{"description":"Newest week first.","content":{"application/json":{"schema":{"type":"object","properties":{"posts":{"type":"array","items":{"$ref":"#/components/schemas/PostListItem"}}},"required":["posts"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"createPost","tags":["posts"],"summary":"Create a draft from a full post document","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostDocument"}}}},"responses":{"201":{"description":"The new draft at version 1.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedPost"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}":{"get":{"operationId":"getPost","tags":["posts"],"summary":"The latest document, version numbers and status","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The post.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostState"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"operationId":"savePost","tags":["posts"],"summary":"Save a new version based on base_version","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"base_version":{"type":"integer","minimum":1},"document":{"$ref":"#/components/schemas/PostDocument"}},"required":["base_version","document"]}}}},"responses":{"200":{"description":"The new version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedPost"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"The save was based on an old version; nothing was stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StaleSave"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/versions":{"get":{"operationId":"listPostVersions","tags":["posts"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Oldest first.","content":{"application/json":{"schema":{"type":"object","properties":{"versions":{"type":"array","items":{"$ref":"#/components/schemas/PostVersionSummary"}}},"required":["versions"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/versions/{n}":{"get":{"operationId":"getPostVersion","tags":["posts"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1},"required":true,"name":"n","in":"path"}],"responses":{"200":{"description":"One version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostVersion"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/versions/{n}/preview":{"get":{"operationId":"previewPostVersion","tags":["posts"],"summary":"Version n as the reader page model, published or not","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1},"required":true,"name":"n","in":"path"}],"responses":{"200":{"description":"The page model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostPage"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/versions/{n}/restore":{"post":{"operationId":"restorePostVersion","tags":["posts"],"summary":"A new version from version n (admin only); publishing is untouched","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1},"required":true,"name":"n","in":"path"}],"responses":{"200":{"description":"The new version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedPost"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/duplicate":{"post":{"operationId":"duplicatePost","tags":["posts"],"summary":"A new draft for the following week from this post's latest version","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"201":{"description":"The new draft.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SavedPost"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/email/handoff":{"post":{"operationId":"prepareEmailHandoff","tags":["email"],"summary":"Record a list send for you to send from your own mailbox (tracked links, nothing sent); `again` after an earlier list send","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"again":{"type":"boolean","default":false},"reply_to":{"type":["string","null"],"maxLength":1278,"description":"One or more addresses, comma-separated (at most 5)."},"untracked":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"The message to send yourself: subject, tracked HTML and text, recipients.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailHandoff"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/email/sends/{send_id}/handoff":{"get":{"operationId":"getEmailHandoff","tags":["email"],"summary":"The prepared message of a hand-off still awaiting confirmation (same link tokens)","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"send_id","in":"path"}],"responses":{"200":{"description":"The message to send yourself: subject, tracked HTML and text, recipients.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailHandoff"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/email/sends/{send_id}/confirm":{"post":{"operationId":"confirmEmailHandoff","tags":["email"],"summary":"Mark a hand-off sent from your mailbox (`sent: true`) or cancel it (`sent: false`)","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"send_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"sent":{"type":"boolean"}},"required":["sent"]}}}},"responses":{"200":{"description":"The recorded send, with each recipient’s outcome.","content":{"application/json":{"schema":{"type":"object","properties":{"send":{"$ref":"#/components/schemas/EmailSend"}},"required":["send"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/render":{"post":{"operationId":"renderPost","tags":["posts"],"summary":"Render an unsaved document (the PUT body) as the reader page model and the email; nothing is stored","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"base_version":{"type":"integer","minimum":1},"document":{"$ref":"#/components/schemas/PostDocument"}},"required":["base_version","document"]}}}},"responses":{"200":{"description":"The page model and the email.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftRender"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/email":{"get":{"operationId":"getPostEmail","tags":["email"],"summary":"The post's email: settings, rendered HTML and text, warnings, sends","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The email preview.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailPreview"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"operationId":"savePostEmail","tags":["email"],"summary":"Subject, preheader and hero image for the email (unversioned)","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailSettings"}}}},"responses":{"200":{"description":"The saved settings.","content":{"application/json":{"schema":{"type":"object","properties":{"settings":{"$ref":"#/components/schemas/EmailSettings"}},"required":["settings"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/email/test":{"post":{"operationId":"sendTestEmail","tags":["email"],"summary":"The published version to the signed-in admin's own address, under a test banner","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reply_to":{"type":["string","null"],"maxLength":1278,"description":"One or more addresses, comma-separated (at most 5)."}}}}}},"responses":{"200":{"description":"The recorded test send and the address it went to.","content":{"application/json":{"schema":{"type":"object","properties":{"send":{"$ref":"#/components/schemas/EmailSend"},"to":{"type":"string"},"message":{"type":"string"}},"required":["send","to","message"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/email/send":{"post":{"operationId":"sendListEmail","tags":["email"],"summary":"The published version to every active recipient; `again` after an earlier list send","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"again":{"type":"boolean","default":false},"reply_to":{"type":["string","null"],"maxLength":1278,"description":"One or more addresses, comma-separated (at most 5)."},"untracked":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"The recorded send, with each recipient’s outcome.","content":{"application/json":{"schema":{"type":"object","properties":{"send":{"$ref":"#/components/schemas/EmailSend"}},"required":["send"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/review":{"get":{"operationId":"getReviewSummary","tags":["review"],"summary":"Review state, verdicts on the latest version, last approved version, open counts","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The review summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewSummary"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/review/page":{"get":{"operationId":"getReviewPage","tags":["review"],"summary":"What the review page reads: the post, its latest version (document and reader page), the summary and every thread","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The review page model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewPage"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/threads":{"get":{"operationId":"listThreads","tags":["review"],"summary":"Every thread with its comments, located in `version` (default the latest)","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1},"required":false,"name":"version","in":"query"}],"responses":{"200":{"description":"Oldest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewThreads"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"startThread","tags":["review"],"summary":"Start a comment thread (admin) or suggest an edit (admin or agent) on a version","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["comment","suggestion"]},"version":{"type":"integer","minimum":1},"anchor":{"$ref":"#/components/schemas/ReviewAnchor"},"body":{"type":"string"},"replacement":{"type":"string"}},"required":["kind","version","body"]}}}},"responses":{"201":{"description":"The thread, located in the latest version.","content":{"application/json":{"schema":{"type":"object","properties":{"thread":{"$ref":"#/components/schemas/ReviewThread"}},"required":["thread"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/threads/{tid}/reopen":{"post":{"operationId":"reopenThread","tags":["review"],"summary":"Reopen a resolved thread (admin or agent)","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"tid","in":"path"}],"responses":{"200":{"description":"The thread, located in the latest version.","content":{"application/json":{"schema":{"type":"object","properties":{"thread":{"$ref":"#/components/schemas/ReviewThread"}},"required":["thread"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Not the latest version (with `latest_version`), a closed thread, not a suggestion, or an outdated suggestion (`outdated: true`); nothing was stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewConflict"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/review/submit":{"post":{"operationId":"submitReview","tags":["review"],"summary":"Move a draft into review (admin or agent); publishing is untouched","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The review summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewSummary"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/versions/{n}/verdict":{"post":{"operationId":"recordVerdict","tags":["review"],"summary":"Approve or request changes on version n, which must be the latest (admin only)","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1},"required":true,"name":"n","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"verdict":{"type":"string","enum":["approve","request_changes"]},"message":{"type":"string"}},"required":["verdict"]}}}},"responses":{"200":{"description":"The review summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewSummary"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Not the latest version (with `latest_version`), a closed thread, not a suggestion, or an outdated suggestion (`outdated: true`); nothing was stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewConflict"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/threads/{tid}/accept":{"post":{"operationId":"acceptSuggestion","tags":["review"],"summary":"Apply a suggestion to the latest version and save it as a new version (admin only)","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"tid","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"base_version":{"type":"integer","minimum":1}},"required":["base_version"]}}}},"responses":{"200":{"description":"The new version and the accepted suggestion.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptedSuggestion"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Not the latest version (with `latest_version`), a closed thread, not a suggestion, or an outdated suggestion (`outdated: true`); nothing was stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewConflict"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/threads/{tid}/dismiss":{"post":{"operationId":"dismissSuggestion","tags":["review"],"summary":"Dismiss an open suggestion (admin only)","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"tid","in":"path"}],"responses":{"200":{"description":"The thread, located in the latest version.","content":{"application/json":{"schema":{"type":"object","properties":{"thread":{"$ref":"#/components/schemas/ReviewThread"}},"required":["thread"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Not the latest version (with `latest_version`), a closed thread, not a suggestion, or an outdated suggestion (`outdated: true`); nothing was stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewConflict"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/threads/{tid}/comments":{"post":{"operationId":"replyToThread","tags":["review"],"summary":"Reply to an open thread (admin or agent)","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"tid","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string"}},"required":["body"]}}}},"responses":{"201":{"description":"The thread, located in the latest version.","content":{"application/json":{"schema":{"type":"object","properties":{"thread":{"$ref":"#/components/schemas/ReviewThread"}},"required":["thread"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Not the latest version (with `latest_version`), a closed thread, not a suggestion, or an outdated suggestion (`outdated: true`); nothing was stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewConflict"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/threads/{tid}/resolve":{"post":{"operationId":"resolveThread","tags":["review"],"summary":"Resolve an open thread (admin only)","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"tid","in":"path"}],"responses":{"200":{"description":"The thread, located in the latest version.","content":{"application/json":{"schema":{"type":"object","properties":{"thread":{"$ref":"#/components/schemas/ReviewThread"}},"required":["thread"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Not the latest version (with `latest_version`), a closed thread, not a suggestion, or an outdated suggestion (`outdated: true`); nothing was stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewConflict"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/posts/{id}/stats":{"get":{"operationId":"postStats","tags":["stats"],"summary":"Views, plays and clicks by day, and per-send clicks by link","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Totals only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostStats"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"No such post or version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/stats":{"get":{"operationId":"statsSummary","tags":["stats"],"summary":"All-time views, plays and clicks per post, and home-page views","responses":{"200":{"description":"Totals only.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatsSummary"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/telemetry/config":{"get":{"operationId":"browserTelemetryConfig","responses":{"200":{"description":"Public browser telemetry configuration.","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"app":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"environment":{"type":"string"},"namespace":{"type":"string","maxLength":64,"pattern":"^[a-z][a-z0-9_]*(?:\\.[a-z][a-z0-9_]*)*$"}},"required":["name","version","environment"]},"sampleRate":{"type":"number","minimum":0,"maximum":1},"relayPath":{"type":"string","enum":["/api/telemetry/rum"]}},"required":["enabled","app","sampleRate","relayPath"]}}}},"500":{"description":"Invalid server configuration."}}}},"/api/telemetry/rum":{"post":{"operationId":"browserTelemetryRelay","responses":{"202":{"description":"Accepted by the collector."},"400":{"description":"Invalid telemetry payload."},"413":{"description":"Payload exceeds the ingress limit."},"429":{"description":"Ingress budget exceeded."},"502":{"description":"Collector unavailable."},"503":{"description":"Browser telemetry disabled."}}}},"/health":{"get":{"operationId":"getHealth","tags":["system"],"summary":"Liveness and dependency readiness","responses":{"200":{"description":"The service and its dependencies are serving.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthReport"}}}},"503":{"description":"A dependency is down; the service should be taken out of rotation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthReport"}}}}}}},"/admin/api/recipients":{"get":{"operationId":"listRecipients","tags":["email"],"responses":{"200":{"description":"By name.","content":{"application/json":{"schema":{"type":"object","properties":{"recipients":{"type":"array","items":{"$ref":"#/components/schemas/Recipient"}}},"required":["recipients"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"addRecipient","tags":["email"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"name":{"type":"string"}},"required":["email","name"]}}}},"responses":{"201":{"description":"The new, active recipient.","content":{"application/json":{"schema":{"type":"object","properties":{"recipient":{"$ref":"#/components/schemas/Recipient"}},"required":["recipient"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/recipients/{id}":{"patch":{"operationId":"updateRecipient","tags":["email"],"summary":"Rename, deactivate or reactivate a recipient","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"The recipient.","content":{"application/json":{"schema":{"type":"object","properties":{"recipient":{"$ref":"#/components/schemas/Recipient"}},"required":["recipient"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"delete":{"operationId":"removeRecipient","tags":["email"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Removed.","content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean","enum":[true]}},"required":["removed"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/outbox":{"get":{"operationId":"listOutbox","tags":["email"],"summary":"Messages the development transport kept instead of sending (newest 50)","responses":{"200":{"description":"Newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"$ref":"#/components/schemas/OutboxMessage"}}},"required":["messages"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/authors":{"get":{"operationId":"listAuthors","tags":["records"],"responses":{"200":{"description":"By slug.","content":{"application/json":{"schema":{"type":"object","properties":{"authors":{"type":"array","items":{"$ref":"#/components/schemas/Author"}}},"required":["authors"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/authors/{slug}":{"put":{"operationId":"saveAuthor","tags":["records"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":80},"required":true,"name":"slug","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"title":{"type":["string","null"]},"email":{"type":["string","null"]},"ask":{"type":["string","null"]},"bio":{"type":["string","null"]},"photo":{"type":["string","null"]},"organisation":{"type":["string","null"]}},"required":["name","title","email","ask","bio","photo"]}}}},"responses":{"200":{"description":"The saved author.","content":{"application/json":{"schema":{"type":"object","properties":{"author":{"$ref":"#/components/schemas/Author"}},"required":["author"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/templates":{"get":{"operationId":"listTemplates","tags":["templates"],"summary":"Every template with its default, and the variables templates can use","responses":{"200":{"description":"In admin order.","content":{"application/json":{"schema":{"type":"object","properties":{"templates":{"type":"array","items":{"$ref":"#/components/schemas/Template"}},"variables":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"outputs":{"type":"array","items":{"type":"string","enum":["email","text","web"]}},"description":{"type":"string"}},"required":["name","outputs","description"]}}},"required":["templates","variables"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/templates/{name}":{"get":{"operationId":"getTemplate","tags":["templates"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"name","in":"path"}],"responses":{"200":{"description":"The template.","content":{"application/json":{"schema":{"type":"object","properties":{"template":{"$ref":"#/components/schemas/Template"}},"required":["template"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"operationId":"saveTemplate","tags":["templates"],"summary":"Store an edited template; it applies to the next render of every post","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"name","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","maxLength":200000}},"required":["source"]}}}},"responses":{"200":{"description":"The saved template.","content":{"application/json":{"schema":{"type":"object","properties":{"template":{"$ref":"#/components/schemas/Template"}},"required":["template"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/templates/{name}/reset":{"post":{"operationId":"resetTemplate","tags":["templates"],"summary":"Delete the stored copy: the template renders its default again","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":64},"required":true,"name":"name","in":"path"}],"responses":{"200":{"description":"The template, now its default.","content":{"application/json":{"schema":{"type":"object","properties":{"template":{"$ref":"#/components/schemas/Template"}},"required":["template"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/templates/preview":{"post":{"operationId":"previewTemplates","tags":["templates"],"summary":"The latest post rendered with unsaved template edits; nothing is stored","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"edits":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64},"source":{"type":"string","maxLength":200000}},"required":["name","source"]},"maxItems":16}},"required":["edits"]}}}},"responses":{"200":{"description":"The email HTML, its text and the web page model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplatePreview"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/settings":{"get":{"operationId":"getSiteSettings","tags":["settings"],"summary":"The live site and email settings, what applies now, and the deploy-only values","responses":{"200":{"description":"The settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteSettings"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"put":{"operationId":"saveSiteSettings","tags":["settings"],"summary":"Replace the site and email settings (admins only); the next page or email uses them","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteSettingsInput"}}}},"responses":{"200":{"description":"The saved settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteSettings"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/engagement/play":{"post":{"operationId":"recordPlay","tags":["site"],"summary":"One play of a published post's video (the reader page's beacon, on first play)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":80}},"required":["slug"]}}}},"responses":{"204":{"description":"Counted, or deliberately not (a robot, an admin, the limit)."},"400":{"description":"The body is not `{slug}`."}}}},"/api/site/home":{"get":{"operationId":"siteHome","tags":["site"],"summary":"The home page: latest published post and earlier weeks","responses":{"200":{"description":"Published posts only, newest week first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HomePage"}}}},"500":{"description":"The stored post could not be rendered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The post store could not be read; the site does not claim it is empty.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/site/posts/{slug}":{"get":{"operationId":"sitePost","tags":["site"],"summary":"One published post page","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":80},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"The published version of the post.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostPage"}}}},"404":{"description":"No published post at that slug (drafts included).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The stored post could not be rendered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"The post store could not be read; the site does not claim it is empty.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/telemetry":{"post":{"operationId":"ingestTelemetry","tags":["system"],"summary":"Accept a batch of browser telemetry events","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelemetryIngestRequest"}}}},"responses":{"202":{"description":"The batch was accepted for export.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelemetryIngestResponse"}}}},"400":{"description":"The batch was malformed or too large.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/media":{"get":{"operationId":"listMedia","tags":["media"],"responses":{"200":{"description":"Newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"media":{"type":"array","items":{"$ref":"#/components/schemas/Media"}}},"required":["media"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"operationId":"uploadMedia","tags":["media"],"summary":"Upload one file (raw body); identical bytes return the existing key","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"name","in":"query"}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"201":{"description":"The stored object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadedMedia"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/media/uploads":{"post":{"operationId":"startMediaUpload","tags":["media"],"summary":"Plan an upload in parts","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"content_type":{"type":"string","minLength":1,"maxLength":100},"size":{"type":"integer","minimum":1},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"}},"required":["name","content_type","size","sha256"]}}}},"responses":{"200":{"description":"Either the bytes are already uploaded, or where to send the parts.","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"status":{"type":"string","enum":["existing"]},"media":{"$ref":"#/components/schemas/UploadedMedia"}},"required":["status","media"]},{"type":"object","properties":{"status":{"type":"string","enum":["started"]},"key":{"type":"string"},"upload_id":{"type":"string"},"part_size":{"type":"integer"}},"required":["status","key","upload_id","part_size"]}]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/media/uploads/{uploadId}/parts/{n}":{"put":{"operationId":"uploadMediaPart","tags":["media"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":1024},"required":true,"name":"uploadId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":10000},"required":true,"name":"n","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":300},"required":true,"name":"key","in":"query"}],"requestBody":{"required":true,"content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"responses":{"200":{"description":"The stored part.","content":{"application/json":{"schema":{"type":"object","properties":{"part_number":{"type":"integer"},"etag":{"type":"string"}},"required":["part_number","etag"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/media/uploads/{uploadId}/complete":{"post":{"operationId":"completeMediaUpload","tags":["media"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":1024},"required":true,"name":"uploadId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"content_type":{"type":"string","minLength":1,"maxLength":100},"size":{"type":"integer","minimum":1},"sha256":{"type":"string","pattern":"^[0-9a-f]{64}$"},"key":{"type":"string","minLength":1,"maxLength":300},"parts":{"type":"array","items":{"type":"object","properties":{"part_number":{"type":"integer","minimum":1},"etag":{"type":"string"}},"required":["part_number","etag"]},"minItems":1}},"required":["name","content_type","size","sha256","key","parts"]}}}},"responses":{"201":{"description":"The stored object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadedMedia"}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"The document or file was refused; every reason is listed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/admin/api/media/email-copies":{"post":{"operationId":"backfillEmailCopies","tags":["media"],"summary":"Admins only: unlink email copies that are not smaller than their originals, then make the missing email copies of up to `limit` uploaded images not yet judged (oldest first; `force=1`: judged ones too); run again until a run copies nothing","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":25,"default":10},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["0","1"],"default":"0"},"required":false,"name":"force","in":"query"}],"responses":{"200":{"description":"One row per image looked at.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/EmailCopyBackfillRow"}}},"required":["results"]}}}},"403":{"description":"The identity is not an admin (or, where allowed, an agent).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"The request could not be served (a store could not be reached).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"webhooks":{}}