docs(catalogs): GET /api/catalogs/measurements contract (chat#1850)#265
Conversation
…test playcounts + derived valuation band Contract for the Catalog HQ homepage hero and chat#1803's deferred landing polish (recoupable/chat#1850). Adds the OpenAPI path, three schemas (CatalogMeasurementsResponse, CatalogTrackMeasurement, ValuationBand), a frontmatter-only reference page, and the nav entry — additive only. The band mirrors the marketing valuation card's model (lifetime-average run-rate, NLS via 1.25/1.4/1.6 gross-up, 15% distribution, 25% royalties, $0.0035/stream, 10/13/16x multiples) so marketing and chat can never drift. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
Adds the OpenAPI contract for
GET /api/catalogs/measurements?catalogId=— per-ISRC latest play counts for a catalog plus a server-derived valuation band{ low, mid, high }.Part of recoupable/chat#1850 (Valuation-first homepage / Catalog HQ) — the data plumbing deferred in chat#1801 / chat#1803. Documentation-driven: this contract merges first, then recoupable/api#757 implements it.
Contract
catalogId(uuid, required). The catalog must belong to the authenticated account (resolved from credentials — Privy bearer orx-api-key— never from input).{ status, measurements[], valuation, total_streams, catalog_age_years }measurements[]— newest capture per ISRC:{ isrc, title, playcount, measured_at }; never-measured songs omitted.valuation—{ low, mid, high }USD, derived at read time (not persisted, per the chat#1850 architecture decision) using the same model as the marketing valuation card (marketing/lib/valuation/computeCatalogValuation.ts): annual run-rate = lifetime streams ÷ catalog age (lifetime-average proxy; earliest Spotify release date, min 1y, default 5y when unknown) → NLS ($0.0035/stream × 1.25/1.4/1.6 all-DSP gross-up × 0.85 post-distribution × 0.75 post-royalty) → 10x/13x/16x master-catalog multiple.catalogId· 401 unauthed · 404 catalog unknown or owned by another account.Changes
api-reference/openapi/releases.json— new path + 3 schemas (CatalogMeasurementsResponse,CatalogTrackMeasurement,ValuationBand), purely additive (surgical insertion, no re-dump; every pre-existing path/schema byte-identical, verified programmatically); JSON re-validated as parseable.api-reference/songs/catalog-measurements.mdx— frontmatter-only reference page (docs#243 pattern).docs.json— nav entry in the Catalogs group.Merge order
main) — the contract.main; the apitest-branch PR flow was retired in api#750).🤖 Generated with Claude Code
Summary by cubic
Adds the OpenAPI contract for
GET /api/catalogs/measurementsto return latest per-ISRC play counts and a server-derived valuation band. This unblocks the Catalog HQ valuation work in chat#1850; API implementation will follow.GET /api/catalogs/measurements?catalogId=inapi-reference/openapi/releases.jsonwith schemas:CatalogMeasurementsResponse,CatalogTrackMeasurement,ValuationBand.measurements[](newest per ISRC),valuation { low, mid, high },total_streams,catalog_age_years; errors: 400/401/404.api-reference/songs/catalog-measurements.mdxand nav entry indocs.json; changes are additive only.Written for commit 8fadc64. Summary will update on new commits.