---
title: "Stories Verticals"
method: GET
path: "/v1/stories/verticals"
---

# Stories Verticals

`GET /v1/stories/verticals`

## Request

- Base URL: `https://api.storyflo.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.storyflo.com/v1/stories/verticals`
- Auth: none declared

Distinct verticals across the corpus — populates filter chips on the
public discovery page. No rate limit; small response, hit once on
page load.

Union of article-derived verticals (canonical six + ≥3-article extras)
and persona-defined verticals (briefing-only verticals from the 24
personas added 2026-05-19). Registered BEFORE the ``/v1/stories/{slug}``
catch-all.

Performance (SEV 2026-06-15): the article-side ``list_verticals`` SELECT
GROUP BY ran a full index-scan + HashAggregate over every row in
``articles`` (it is now a skip scan, ``search._list_verticals_stmt``).
Cold prod wall-clock was timing out at 15s, blocking the
chip row on ``storyflo.com/stories``. Wrapped in
``verticals_cache.VerticalsCache`` (5-min TTL, single-flight) so the
cold path fires at most once per worker per TTL window. Same shape
as ``trending_cache`` / ``search_cache``. The persona-vertical SELECT
is in the cached compute too — same dimensionality (~24 active
personas), and the merged ``verticals`` list is what downstream
callers consume, so caching the union not the parts matches the
invalidation cadence.

Pool-exhaustion fix 2026-06-21 (follow-up to PRs #657 + #658):
deliberately no ``db: AsyncSession = Depends(get_db_replica)``
parameter. The chip row is on the storyflo.com/stories home path
and shares the same anti-pattern that caused the 2026-06-20 P0 on
/v1/search/hybrid — a request-scoped Depends session held across
``cache.get_or_compute`` exhausts the basic-plan pool
(POOL_SIZE=5 + MAX_OVERFLOW=3 = 8 total) on a single-flight wait
storm. Only the OWNER opens a short-lived replica session inside
``_compute`` and releases it via ``_close_session_safely`` before
return; non-owners hold zero connections while awaiting the shared
Future.

## Response `200`

Successful Response

- object

---

[API](https://skmtc.dev/storyflo/apis/storyflo-inference-router.md) · [All operations](https://skmtc.dev/storyflo/apis/storyflo-inference-router/llms.txt) · [OpenAPI document](https://skmtc.dev/storyflo/apis/storyflo-inference-router/revisions/c3a1a735ac7a?raw)
