Skip to content

docs(docs): migrate GET /api/accounts/{id}/catalogs#153

Merged
sweetmantech merged 4 commits into
mainfrom
feat/account-catalogs-migration-docs
Apr 23, 2026
Merged

docs(docs): migrate GET /api/accounts/{id}/catalogs#153
sweetmantech merged 4 commits into
mainfrom
feat/account-catalogs-migration-docs

Conversation

@arpitgupta1214
Copy link
Copy Markdown
Collaborator

@arpitgupta1214 arpitgupta1214 commented Apr 21, 2026

Replace legacy GET /api/catalogs operation with GET /api/accounts/{id}/catalogs on recoup-api.vercel.app; account id moves from query to path; drop unused POST/DELETE entries.

Test plan

  • Mintlify preview renders the migrated page with recoup-api.vercel.app and {id} path param
  • Response codes list 200, 400, 401, 403, 404, 500
  • Legacy /api/catalogs path key absent from releases.json

Summary by CodeRabbit

  • API Updates
    • Catalogs endpoint restructured to /api/accounts/{id}/catalogs with account ID as a required path parameter
    • Removed POST and DELETE operations from this endpoint
    • Updated error response documentation and response descriptions

Move the account id from a query param to a path segment on the GET
operation, drop the per-operation api.recoupable.com servers override
so the page renders against recoup-api.vercel.app, and enumerate the
full response code set the new handler emits (200, 400, 401, 403, 404,
500). POST and DELETE overrides stay on the legacy /api/catalogs path
until their own migrations land.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

📝 Walkthrough

Walkthrough

The catalogs API path was changed from /api/catalogs to /api/accounts/{id}/catalogs, moving the account identifier from a required query parameter to a required path parameter; OpenAPI and MDX docs were updated and the separate create/delete catalog docs/pages were removed or adjusted.

Changes

Cohort / File(s) Summary
OpenAPI Specification
api-reference/openapi/releases.json
Replaced /api/catalogs with /api/accounts/{id}/catalogs. Moved account_id from required query to required path param id (UUID). Removed post/delete operations for this path. Updated GET error responses (added/changed 401, 403, 500; revised 404 and 400 wording).
Docs — Catalogs MDX
api-reference/songs/catalogs.mdx
Frontmatter changed from unquoted get /api/catalogs to OpenAPI reference /api-reference/openapi/releases.json GET /api/accounts/{id}/catalogs; removed note about POST/DELETE capabilities.
Docs — Removed Create/Delete pages
api-reference/songs/catalogs-create.mdx, api-reference/songs/catalogs-delete.mdx
Deleted MDX pages/frontmatter and explanatory notes for creating and deleting catalogs (these docs removed from navigation).
Documentation Index
docs.json
Removed references to the now-removed catalogs-create and catalogs-delete pages from the Releases → Songs & Catalogs navigation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • sweetmantech

Poem

🐰 I hopped through JSON, changed a route,
Moved the id to where it's about,
Docs trimmed tidy, pages fell away,
Accounts now lead the catalog way,
A small rabbit cheer to mark the day! 🎈

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: migrating the GET endpoint from /api/catalogs to /api/accounts/{id}/catalogs, which is the core focus of the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/account-catalogs-migration-docs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="api-reference/openapi/releases.json">

<violation number="1" location="api-reference/openapi/releases.json:854">
P1: The Get Catalogs MDX page still references `get /api/catalogs`, but this PR moves that operation to `/api/accounts/{id}/catalogs`. Update the MDX `openapi` target to the new path to avoid a broken API reference page.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread api-reference/openapi/releases.json
…catalogs path

The releases.json no longer exposes GET /api/catalogs after migration, so the
page was rendering empty. Update the frontmatter to reference the new
account-scoped path in releases.json.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@api-reference/openapi/releases.json`:
- Around line 853-854: Re-add the legacy path key "/api/catalogs" to the OpenAPI
spec in releases.json containing only the post and delete operations (preserve
their operation definitions and schemas as they were) so
api-reference/songs/catalogs-create.mdx and catalogs-delete.mdx find matching
operations; do not reintroduce GET (since that moved to
"/api/accounts/{id}/catalogs"), ensure the operationId, requestBody, parameters
and responses for POST and DELETE match the original definitions so Mintlify can
auto-generate the request/response sections for those docs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 29c8d05a-25ec-46d4-b02a-5f48fb53e6ee

📥 Commits

Reviewing files that changed from the base of the PR and between ea3c08a and 2bb54c3.

📒 Files selected for processing (2)
  • api-reference/openapi/releases.json
  • api-reference/songs/catalogs.mdx

Comment on lines 853 to +854
},
"/api/catalogs": {
"/api/accounts/{id}/catalogs": {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm that no /api/catalogs path key remains and that the MDX pages still reference it.
echo "=== /api/catalogs occurrences in releases.json ==="
rg -n '"/api/catalogs"' api-reference/openapi/releases.json || echo "(none — legacy path fully removed)"

echo
echo "=== MDX pages still referencing legacy /api/catalogs ==="
rg -n --type=md --type-add 'mdx:*.mdx' --type=mdx '^openapi:.*\b/api/catalogs\b' api-reference || true

Repository: recoupable/docs

Length of output: 202


🏁 Script executed:

#!/bin/bash
# Find the actual MDX files and check their content
echo "=== Locating catalogs-create.mdx ==="
fd -name "catalogs-create.mdx" api-reference

echo
echo "=== Locating catalogs-delete.mdx ==="
fd -name "catalogs-delete.mdx" api-reference

echo
echo "=== Locating all catalogs-related mdx files ==="
fd -name "*catalogs*.mdx" api-reference

Repository: recoupable/docs

Length of output: 892


🏁 Script executed:

#!/bin/bash
# Find the actual MDX files and check their content
echo "=== Locating catalogs-related mdx files ==="
fd "catalogs.*\.mdx" api-reference

echo
echo "=== Searching for any mdx files in api-reference ==="
fd "\.mdx$" api-reference | head -20

Repository: recoupable/docs

Length of output: 974


🏁 Script executed:

#!/bin/bash
echo "=== Content of catalogs-create.mdx ==="
cat api-reference/songs/catalogs-create.mdx

echo
echo "=== Content of catalogs-delete.mdx ==="
cat api-reference/songs/catalogs-delete.mdx

echo
echo "=== Content of catalogs.mdx ==="
cat api-reference/songs/catalogs.mdx

Repository: recoupable/docs

Length of output: 1106


🏁 Script executed:

#!/bin/bash
# Check what operations exist on /api/accounts/{id}/catalogs in releases.json
echo "=== Checking /api/accounts/{id}/catalogs operations ==="
rg -A 200 '"/api/accounts/\{id\}/catalogs"' api-reference/openapi/releases.json | head -250

Repository: recoupable/docs

Length of output: 6431


🏁 Script executed:

#!/bin/bash
# Search for POST and DELETE operations on the accounts catalogs path
echo "=== Searching for POST on catalogs path ==="
rg -n '"post"' api-reference/openapi/releases.json | grep -i catalog

echo
echo "=== Searching for DELETE on catalogs path ==="
rg -n '"delete"' api-reference/openapi/releases.json | grep -i catalog

echo
echo "=== Full /api/catalogs search ==="
rg -n '/api/catalogs' api-reference/openapi/releases.json

echo
echo "=== Check if /api/accounts/{id}/catalogs has more than just get ==="
sed -n '/\/api\/accounts\/\{id\}\/catalogs/,/^    "\/api\//p' api-reference/openapi/releases.json | head -50

Repository: recoupable/docs

Length of output: 359


🏁 Script executed:

#!/bin/bash
# Final verification: check releases.json structure around accounts catalogs to confirm only GET exists
echo "=== Lines 850-900 of releases.json showing /api/accounts/{id}/catalogs ==="
sed -n '850,900p' api-reference/openapi/releases.json

Repository: recoupable/docs

Length of output: 1696


Removing the /api/catalogs path key breaks the Create Catalogs and Delete Catalogs doc pages.

This PR drops the entire /api/catalogs path key from releases.json, but api-reference/songs/catalogs-create.mdx still has openapi: post /api/catalogs and api-reference/songs/catalogs-delete.mdx still has openapi: delete /api/catalogs. With no matching operation in any mounted spec, Mintlify will render those two pages with only the title/description and no auto-generated request/response section — the exact failure mode that motivated commit 3 for catalogs.mdx.

The PR description also explicitly states POST and DELETE should remain on the legacy path until their own migrations land, so this removal appears unintended.

The new /api/accounts/{id}/catalogs path only includes the GET operation; POST and DELETE are entirely missing from the spec.

Two options to unbreak those pages before merge:

  1. Re-add the legacy /api/catalogs key with only the post and delete operations preserved (keep GET removed since it has moved).
  2. Migrate catalogs-create.mdx and catalogs-delete.mdx to reference the new account-scoped paths in the same PR (requires server-side routes to exist for POST/DELETE).

Option 1 matches the stated merge plan most closely.

🔧 Proposed fix — restore legacy path with POST/DELETE only
+    "/api/catalogs": {
+      "post": { /* preserved POST operation spec */ },
+      "delete": { /* preserved DELETE operation spec */ }
+    },
     "/api/accounts/{id}/catalogs": {
       "get": {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@api-reference/openapi/releases.json` around lines 853 - 854, Re-add the
legacy path key "/api/catalogs" to the OpenAPI spec in releases.json containing
only the post and delete operations (preserve their operation definitions and
schemas as they were) so api-reference/songs/catalogs-create.mdx and
catalogs-delete.mdx find matching operations; do not reintroduce GET (since that
moved to "/api/accounts/{id}/catalogs"), ensure the operationId, requestBody,
parameters and responses for POST and DELETE match the original definitions so
Mintlify can auto-generate the request/response sections for those docs.

These MDX pages referenced the legacy /api/catalogs POST/DELETE operations
that were removed from releases.json. The verbs have no live caller and
are not scheduled for migration. Also drop the Note callout on the Get
Catalogs page referencing them.
@arpitgupta1214
Copy link
Copy Markdown
Collaborator Author

Mintlify preview — GET /api/accounts/{id}/catalogs

Get Catalogs preview

Captured from a local npx mintlify@latest dev on commit 98d7ecb. Shows:

  • Path GET /api/accounts/{id}/catalogs with {id} as a required UUID path parameter
  • Server inherited from top-level: recoup-api.vercel.app
  • Response codes 200 / 400 / 401 / 403 / 404 / 500
  • Response shape { status, catalogs: [{ id, name, created_at, updated_at }], error }
  • Sidebar no longer lists the removed POST Create Catalogs / DEL Delete Catalogs pages; the Note callout referencing them on this page was also dropped.

Rolling comment — will be replaced on further changes and the preview-assets branch deleted on merge.

@arpitgupta1214 arpitgupta1214 changed the title docs: migrate GET /api/catalogs → /api/accounts/{id}/catalogs docs(docs): migrate GET /api/accounts/{id}/catalogs Apr 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants