{"openapi":"3.1.0","info":{"title":"Docket Curation Tool","version":"0.1.0"},"paths":{"/api/auth/request-code":{"post":{"summary":"Request Code","description":"Email a code to an allowed address. The answer is the same whether or\nnot the address is allowed, so it can't be used to discover who is.","operationId":"request_code_api_auth_request_code_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/verify":{"post":{"summary":"Verify Code","operationId":"verify_code_api_auth_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeVerify"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth":{"post":{"summary":"Password Sign In","description":"Break-glass sign-in with TOOL_PASSWORD, while it is set.","operationId":"password_sign_in_api_auth_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordSignIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/me":{"get":{"summary":"Me","operationId":"me_api_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/logout":{"post":{"summary":"Logout","operationId":"logout_api_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/publications":{"get":{"summary":"List Publications","description":"Active publications shown in the topbar dropdown; one with\n`issue_format` is listed twice there (Classic and Issue).","operationId":"list_publications_api_publications_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/publications/{slug}/config":{"get":{"summary":"Get Publication Config","description":"Read-only summary for the Settings tab.","operationId":"get_publication_config_api_publications__slug__config_get","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","title":"Slug"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today":{"get":{"summary":"Get Today","description":"Return the shortlist for today, or fall back to the most recent run.\n\nThe cron is Mon-Fri only and runs once daily, so the dashboard would\notherwise be empty overnight, on weekends, and after any cron failure.\nFalling back to the latest available run keeps the editor's queue\npopulated and surfaces the run_date so the frontend can flag stale data.","operationId":"get_today_api_today_get","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today/newsletter-html":{"get":{"summary":"Get Newsletter Html","description":"Render today's selections as a single HTML chunk for paste into\nbeehiiv's HTML Snippet block. Returns \"\" when there are no selections.","operationId":"get_newsletter_html_api_today_newsletter_html_get","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today/wordpress":{"get":{"summary":"Get Wordpress","description":"Today's selections as WordPress Gutenberg block markup for paste into\nthe block editor of a \"Daily Updates\" post, plus a suggested title and\nsubtitle and the lead image URL (set by hand in WordPress for now).\nSame date fallback and clip shape as /api/today/newsletter-html.\nAlso reports whether direct posting is configured for the pub and the\npost already sent for this run_date, if any. `date` picks a past day,\nand `issue` then summarizes that day's Issue-version issue, if any.","operationId":"get_wordpress_api_today_wordpress_get","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}},{"name":"date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today/wordpress/send":{"post":{"summary":"Send Wordpress","description":"Publish (or update) the day's WordPress post.\n\nOne post per (pub, run_date), tracked in wp_posts: the first send publishes\na post in the pub's category as its author, dated at the configured send\ntime (WordPress schedules it if that is still ahead); later sends update\nthat same post, live or not, so changes made in the tool reach the site\nand re-sending never leaves duplicates behind. A post that was deleted in\nWordPress (404 on lookup, or in the trash) is recreated. Requires the\nX-Tool-Token action token. `date` sends a past day (backfilling the\nwebsite), dated at that morning's send time.","operationId":"send_wordpress_api_today_wordpress_send_post","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}},{"name":"date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WordPressSendRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/beehiiv/webhook":{"post":{"summary":"Beehiiv Webhook","description":"beehiiv's post.sent webhook (one endpoint per publication, ?pub=slug):\nwhen the newsletter goes out, publish the issue that was sent to the\npub's website (its web version as WordPress blocks, see beehiiv_web),\nunder the sent post's title and subtitle, the same way Publish to\nWordPress does.\n\nOpen to beehiiv without a session (auth.WEBHOOK_PATHS). Once\nBEEHIIV_WEBHOOK_SECRETS is set, requests without beehiiv's signature are\nrefused; either way the post is looked up in beehiiv, and only a post\nbeehiiv says was sent is acted on. A WordPress failure answers 502 so\nbeehiiv retries; the day's post is created once and updated after.","operationId":"beehiiv_webhook_api_beehiiv_webhook_post","parameters":[{"name":"pub","in":"query","required":true,"schema":{"type":"string","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/beehiiv/publish-sent":{"post":{"summary":"Publish Sent","description":"Publish the issue the pub sent on `date` to its website, as the\nwebhook would have (a missed day, or one sent before the webhook).","operationId":"publish_sent_api_beehiiv_publish_sent_post","parameters":[{"name":"pub","in":"query","required":true,"schema":{"type":"string","title":"Pub"}},{"name":"date","in":"query","required":true,"schema":{"type":"string","title":"Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today/selections":{"get":{"summary":"Get Selections","description":"Return the current selection state for today's run (or the latest\nrun that has selections, mirroring /api/today/newsletter-html's\nfallback). Joined to articles (title, url, source_name) and shortlists\n(suggested_excerpt) so the Compose tab can render and edit in one fetch.","operationId":"get_selections_api_today_selections_get","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/submit":{"post":{"summary":"Submit","description":"Persist today's selections for the given pub. Returns the inserted\nrows with IDs so the caller (Compose tab) can PATCH them.\n\nPreserves `commentary_after` across the DELETE+re-INSERT cycle by\npre-fetching existing values keyed on article_id. This matters\nbecause reorders or Today-tab toggles re-call submit and must not\nwipe Compose-authored commentary.\n\nThe legacy beehiiv draft creation path is intentionally removed —\nit returned 501 on Scale plans and was unused by the current frontend.","operationId":"submit_api_submit_post","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today/manual-link":{"post":{"summary":"Add Manual Link","description":"Add a manually-supplied article to today's selections.\n\nThe URL+title come from a Compose-tab modal; the editor found the article\noutside the scorer pipeline. We insert (or reuse) an articles row with\nfeed_id=NULL and append a selection at position max+1 for today/pub.","operationId":"add_manual_link_api_today_manual_link_post","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManualLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today/selections/reorder":{"post":{"summary":"Reorder Selections","description":"Batch-update positions for the current pub's selections in one transaction.\nValidates every id belongs to this pub before writing.","operationId":"reorder_selections_api_today_selections_reorder_post","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReorderRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today/selections/{selection_id}":{"patch":{"summary":"Patch Selection","description":"Update one or both editable fields on a selection row.\n\nFields default to None on the request model; a None value means \"do not\ntouch this column.\" An explicit empty string clears the column.\n\nReturns the updated row. 404 if the selection_id is unknown.","operationId":"patch_selection_api_today_selections__selection_id__patch","parameters":[{"name":"selection_id","in":"path","required":true,"schema":{"type":"integer","title":"Selection Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelectionPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Selection","description":"Delete a selection (manual or scored).\n\nFor manual articles (feed_id IS NULL), also removes the orphan article row\nif no other selection references it. Scored articles are left in place so\nthey remain available in the Today tab for re-selection.","operationId":"delete_selection_api_today_selections__selection_id__delete","parameters":[{"name":"selection_id","in":"path","required":true,"schema":{"type":"integer","title":"Selection Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/feeds/test":{"post":{"summary":"Test Feed","operationId":"test_feed_api_feeds_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedTestRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/feeds":{"get":{"summary":"Get Feeds","operationId":"get_feeds_api_feeds_get","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"summary":"Create Feed","operationId":"create_feed_api_feeds_post","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/feeds/{feed_id}":{"patch":{"summary":"Update Feed","operationId":"update_feed_api_feeds__feed_id__patch","parameters":[{"name":"feed_id","in":"path","required":true,"schema":{"type":"integer","title":"Feed Id"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Delete Feed","operationId":"delete_feed_api_feeds__feed_id__delete","parameters":[{"name":"feed_id","in":"path","required":true,"schema":{"type":"integer","title":"Feed Id"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/people/today":{"get":{"summary":"Get People Today","description":"Pending candidates within 14 days for the given publication, banded sort (band ASC, score DESC).\n\nBands: 0 = 0-3 days, 1 = 4-7 days, 2 = 8-14 days.","operationId":"get_people_today_api_people_today_get","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/people/by-status":{"get":{"summary":"Get People By Status","operationId":"get_people_by_status_api_people_by_status_get","parameters":[{"name":"status","in":"query","required":true,"schema":{"type":"string","title":"Status"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/people/{candidate_id}/status":{"patch":{"summary":"Update Person Status","operationId":"update_person_status_api_people__candidate_id__status_patch","parameters":[{"name":"candidate_id","in":"path","required":true,"schema":{"type":"integer","title":"Candidate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PeopleStatusUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/today/wordpress/backfill":{"post":{"summary":"Backfill Wordpress","description":"Queue publishing every weekday from `from` to `to` to the pub's website\nfrom that day's top-scored stories (website_backfill.py). Days already\nsent are skipped. Runs as a background job; progress is in the logs.","operationId":"backfill_wordpress_api_today_wordpress_backfill_post","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}},{"name":"from","in":"query","required":true,"schema":{"type":"string","title":"From"}},{"name":"to","in":"query","required":true,"schema":{"type":"string","title":"To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/trigger-ingest":{"post":{"summary":"Trigger Ingest","description":"Queue an ingest+scoring run for the publication. The work runs in a\nseparate `python -m jobs ingest` process (see the serial job queue) so the\nweb server's memory is unaffected. Returns immediately.","operationId":"trigger_ingest_api_trigger_ingest_post","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/trigger-people":{"post":{"summary":"Trigger People","description":"Queue a People-pipeline run for the publication in a separate\n`python -m jobs people` process. The full run (76 firms × Haiku extract +\nSonnet score) takes 8-12 min and runs entirely outside the web process.\n\nPoll /api/people/today to watch new candidates arrive.","operationId":"trigger_people_api_trigger_people_post","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/meme/search":{"get":{"summary":"Meme Search","description":"Proxy Giphy search — keeps the API key server-side.","operationId":"meme_search_api_meme_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"title":"Q"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":24,"minimum":1,"default":12,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/image/upload":{"post":{"summary":"Image Upload","description":"Upload an image to Cloudinary; return an email-optimized delivery URL.\n\nMirrors the meme proxy: credentials stay server-side, 502 when unconfigured.","operationId":"image_upload_api_image_upload_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_image_upload_api_image_upload_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/congress/weeks":{"get":{"summary":"List Weeks","description":"Weeks that have items or an issue, newest first, always including\nthe current week and the one that just ended.","operationId":"list_weeks_api_congress_weeks_get","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/congress/feed":{"get":{"summary":"Get Feed","description":"Everything collected for the week, plus each source's latest run.","operationId":"get_feed_api_congress_feed_get","parameters":[{"name":"week","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Week"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/congress/feed.csv":{"get":{"summary":"Get Feed Csv","operationId":"get_feed_csv_api_congress_feed_csv_get","parameters":[{"name":"week","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Week"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/congress/issue":{"get":{"summary":"Get Issue","operationId":"get_issue_api_congress_issue_get","parameters":[{"name":"week","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Week"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/congress/issue/newsletter-html":{"get":{"summary":"Get Issue Html","operationId":"get_issue_html_api_congress_issue_newsletter_html_get","parameters":[{"name":"week","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Week"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"text/plain":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/congress/issue/wordpress":{"get":{"summary":"Get Issue Wordpress","operationId":"get_issue_wordpress_api_congress_issue_wordpress_get","parameters":[{"name":"week","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Week"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/trigger-congress":{"post":{"summary":"Trigger Congress","description":"For the scheduler: step=collect gathers and reads the week's items.\n(Claude does not draft the issue; the reporter builds it.)","operationId":"trigger_congress_api_trigger_congress_post","parameters":[{"name":"step","in":"query","required":true,"schema":{"type":"string","title":"Step"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/congress/collect":{"post":{"summary":"Collect Now","operationId":"collect_now_api_congress_collect_post","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/congress/issue/entries/{entry_id}":{"patch":{"summary":"Patch Entry","operationId":"patch_entry_api_congress_issue_entries__entry_id__patch","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"integer","title":"Entry Id"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/congress__routes__EntryUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Remove Entry","operationId":"remove_entry_api_congress_issue_entries__entry_id__delete","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"integer","title":"Entry Id"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/congress/issue/entries":{"post":{"summary":"Add Entry","operationId":"add_entry_api_congress_issue_entries_post","parameters":[{"name":"week","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Week"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/congress__routes__EntryAdd"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/congress/issue/reorder":{"post":{"summary":"Reorder Entries","operationId":"reorder_entries_api_congress_issue_reorder_post","parameters":[{"name":"week","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Week"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reorder"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/congress/issue/suggestions":{"get":{"summary":"Get Suggestions","description":"Top-ranked clips for the week not yet in the issue. The first\nDEFAULT_CLIPS start an empty issue; the rest are alternates.","operationId":"get_suggestions_api_congress_issue_suggestions_get","parameters":[{"name":"week","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Week"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/congress/issue/meta":{"put":{"summary":"Put Meta","operationId":"put_meta_api_congress_issue_meta_put","parameters":[{"name":"week","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Week"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/congress__routes__IssueMeta"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/congress/issue/suggest-title":{"post":{"summary":"Suggest Title","description":"Claude's title and \"Plus, …\" subtitle from the issue's own clips.\nReturned for the editor to accept; nothing is saved.","operationId":"suggest_title_api_congress_issue_suggest_title_post","parameters":[{"name":"week","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Week"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/congress/archive":{"get":{"summary":"Archive Status","description":"How far the related-history archive backfill has got.","operationId":"archive_status_api_congress_archive_get","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/congress/archive/backfill":{"post":{"summary":"Archive Backfill","description":"Queue one chunk of the archive backfill (back to Jan 2025). It\nspends Claude credits, so it needs the action token.","operationId":"archive_backfill_api_congress_archive_backfill_post","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"congressional","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/daily/issue":{"get":{"summary":"Get Issue","operationId":"get_issue_api_daily_issue_get","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/daily/results":{"get":{"summary":"Get Results","description":"Clicks per issue (Issue version vs the Classic issues before it)\nand by story type and section, from the last beehiiv sync.","operationId":"get_results_api_daily_results_get","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/daily/results/sync":{"post":{"summary":"Sync Results","operationId":"sync_results_api_daily_results_sync_post","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/daily/prepare":{"post":{"summary":"Prepare","description":"Rank the day's stories and draft the top ones in the background\n(the same step the morning ingest runs).","operationId":"prepare_api_daily_prepare_post","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/daily/issue/start":{"post":{"summary":"Start Issue","operationId":"start_issue_api_daily_issue_start_post","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartIssue"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/daily/issue/entries":{"post":{"summary":"Add Entry","operationId":"add_entry_api_daily_issue_entries_post","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/daily__routes__EntryAdd"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/daily/items/{item_id}/redraft":{"post":{"summary":"Redraft Item","description":"Draft a story again in the background (after a weak draft, or once\nits source can be read).","operationId":"redraft_item_api_daily_items__item_id__redraft_post","parameters":[{"name":"item_id","in":"path","required":true,"schema":{"type":"integer","title":"Item Id"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/daily/issue/entries/{entry_id}":{"patch":{"summary":"Patch Entry","operationId":"patch_entry_api_daily_issue_entries__entry_id__patch","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"integer","title":"Entry Id"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/daily__routes__EntryUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"summary":"Remove Entry","operationId":"remove_entry_api_daily_issue_entries__entry_id__delete","parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"integer","title":"Entry Id"}},{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/daily/issue/reorder":{"post":{"summary":"Reorder","operationId":"reorder_api_daily_issue_reorder_post","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reorder"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/daily/issue/meta":{"put":{"summary":"Put Meta","operationId":"put_meta_api_daily_issue_meta_put","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/daily__routes__IssueMeta"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/daily/issue/newsletter-html":{"get":{"summary":"Get Issue Html","operationId":"get_issue_html_api_daily_issue_newsletter_html_get","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/daily/issue/wordpress":{"get":{"summary":"Get Issue Wordpress","operationId":"get_issue_wordpress_api_daily_issue_wordpress_get","parameters":[{"name":"pub","in":"query","required":false,"schema":{"type":"string","default":"securities","title":"Pub"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ArticleSelection":{"properties":{"article_id":{"type":"integer","title":"Article Id"},"final_excerpt":{"type":"string","title":"Final Excerpt"},"position":{"type":"integer","title":"Position"}},"type":"object","required":["article_id","final_excerpt","position"],"title":"ArticleSelection"},"Body_image_upload_api_image_upload_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Body_image_upload_api_image_upload_post"},"CodeRequest":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"CodeRequest"},"CodeVerify":{"properties":{"email":{"type":"string","title":"Email"},"code":{"type":"string","title":"Code"}},"type":"object","required":["email","code"],"title":"CodeVerify"},"FeedCreate":{"properties":{"name":{"type":"string","title":"Name"},"url":{"type":"string","title":"Url"},"is_paywalled":{"type":"boolean","title":"Is Paywalled","default":false}},"type":"object","required":["name","url"],"title":"FeedCreate"},"FeedTestRequest":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"FeedTestRequest"},"FeedUpdate":{"properties":{"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"is_paywalled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Paywalled"}},"type":"object","title":"FeedUpdate"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ManualLinkRequest":{"properties":{"url":{"type":"string","title":"Url"},"title":{"type":"string","title":"Title"}},"type":"object","required":["url","title"],"title":"ManualLinkRequest"},"PasswordSignIn":{"properties":{"password":{"type":"string","title":"Password"}},"type":"object","required":["password"],"title":"PasswordSignIn"},"PeopleStatusUpdate":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"PeopleStatusUpdate"},"Reorder":{"properties":{"entry_ids":{"items":{"type":"integer"},"type":"array","title":"Entry Ids"}},"type":"object","required":["entry_ids"],"title":"Reorder"},"ReorderItem":{"properties":{"id":{"type":"integer","title":"Id"},"position":{"type":"integer","minimum":0.0,"title":"Position"}},"type":"object","required":["id","position"],"title":"ReorderItem"},"ReorderRequest":{"properties":{"positions":{"items":{"$ref":"#/components/schemas/ReorderItem"},"type":"array","title":"Positions"}},"type":"object","required":["positions"],"title":"ReorderRequest"},"SelectionPatch":{"properties":{"final_excerpt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Final Excerpt"},"commentary_after":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Commentary After"},"source_name_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Name Override"},"title_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title Override"}},"type":"object","title":"SelectionPatch"},"StartIssue":{"properties":{"clip_ids":{"items":{"type":"integer"},"type":"array","title":"Clip Ids"}},"type":"object","required":["clip_ids"],"title":"StartIssue"},"SubmitRequest":{"properties":{"articles":{"items":{"$ref":"#/components/schemas/ArticleSelection"},"type":"array","title":"Articles"}},"type":"object","required":["articles"],"title":"SubmitRequest"},"SuppliedClip":{"properties":{"title":{"type":"string","title":"Title"},"url":{"type":"string","title":"Url"},"source_name":{"type":"string","title":"Source Name","default":""},"excerpt":{"type":"string","title":"Excerpt","default":""},"commentary_after":{"type":"string","title":"Commentary After","default":""}},"type":"object","required":["title","url"],"title":"SuppliedClip"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WordPressSendRequest":{"properties":{"title":{"type":"string","title":"Title"},"subtitle":{"type":"string","title":"Subtitle","default":""},"format":{"type":"string","title":"Format","default":"classic"},"clips":{"anyOf":[{"items":{"$ref":"#/components/schemas/SuppliedClip"},"type":"array"},{"type":"null"}],"title":"Clips"}},"type":"object","required":["title"],"title":"WordPressSendRequest"},"congress__routes__EntryAdd":{"properties":{"item_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Item Id"},"section":{"type":"string","title":"Section","default":"clips"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","title":"EntryAdd","description":"A collected item (`item_id`) as a clip or See Also item, or a pasted\nlink (`url`) as a See Also item or Recommended Read."},"congress__routes__EntryUpdate":{"properties":{"headline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Headline"},"date_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Label"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"pull_quote":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pull Quote"},"history":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"History"},"commentary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Commentary"},"group_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Name"},"links":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Links"}},"type":"object","title":"EntryUpdate"},"congress__routes__IssueMeta":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtitle"},"intro_line":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Intro Line"},"ps":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ps"},"trivia":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Trivia"},"headings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Headings"}},"type":"object","title":"IssueMeta"},"daily__routes__EntryAdd":{"properties":{"daily_item_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Daily Item Id"},"section":{"type":"string","title":"Section","default":"clips"},"candidate_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Candidate Id"}},"type":"object","title":"EntryAdd"},"daily__routes__EntryUpdate":{"properties":{"headline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Headline"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"commentary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Commentary"},"date_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Label"}},"type":"object","title":"EntryUpdate"},"daily__routes__IssueMeta":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"subtitle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subtitle"},"headings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Headings"}},"type":"object","title":"IssueMeta"}}}}