diff --git a/api-reference/openapi/releases.json b/api-reference/openapi/releases.json index 4a21d38e..b46f1d22 100644 --- a/api-reference/openapi/releases.json +++ b/api-reference/openapi/releases.json @@ -851,18 +851,13 @@ } } }, - "/api/catalogs": { + "/api/accounts/{id}/catalogs": { "get": { - "servers": [ - { - "url": "https://api.recoupable.com" - } - ], "description": "Retrieve catalogs associated with a specific account. The endpoint joins account_catalogs with catalogs to return catalog metadata for the specified account.", "parameters": [ { - "name": "account_id", - "in": "query", + "name": "id", + "in": "path", "description": "The unique identifier of the account to query", "required": true, "schema": { @@ -883,7 +878,7 @@ } }, "400": { - "description": "Bad request - missing or invalid account_id", + "description": "Bad request - missing or invalid account id", "content": { "application/json": { "schema": { @@ -892,8 +887,8 @@ } } }, - "404": { - "description": "Account not found or no catalogs found", + "401": { + "description": "Unauthorized - missing or invalid authentication", "content": { "application/json": { "schema": { @@ -901,40 +896,9 @@ } } } - } - } - }, - "post": { - "servers": [ - { - "url": "https://api.recoupable.com" - } - ], - "description": "Create new catalogs or link existing catalogs to an account. If catalog_id is provided, links the existing catalog. If name is provided without catalog_id, creates a new catalog. If both are provided, catalog_id takes priority.", - "requestBody": { - "description": "Array of catalogs to create or link", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CreateCatalogsRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Catalogs created or linked successfully", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/CatalogsResponse" - } - } - } }, - "400": { - "description": "Bad request - invalid parameters or catalog_id not found", + "403": { + "description": "Forbidden - caller lacks access to the target account", "content": { "application/json": { "schema": { @@ -942,40 +906,19 @@ } } } - } - } - }, - "delete": { - "servers": [ - { - "url": "https://api.recoupable.com" - } - ], - "description": "Unlink catalogs from an account. If no other accounts are linked to a catalog after removal, the catalog is automatically deleted (cascading to catalog_songs). Otherwise, only the account-catalog relationship is removed.", - "requestBody": { - "description": "Array of catalog-account pairs to remove", - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/DeleteCatalogsRequest" - } - } - } - }, - "responses": { - "200": { - "description": "Catalogs unlinked successfully", + }, + "404": { + "description": "Account not found", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/CatalogsResponse" + "$ref": "#/components/schemas/CatalogsErrorResponse" } } } }, - "400": { - "description": "Bad request - missing catalog_id or account_id", + "500": { + "description": "Internal server error", "content": { "application/json": { "schema": { diff --git a/api-reference/songs/catalogs-create.mdx b/api-reference/songs/catalogs-create.mdx deleted file mode 100644 index b0d690ab..00000000 --- a/api-reference/songs/catalogs-create.mdx +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Create Catalogs -openapi: post /api/catalogs ---- - - - If `catalog_id` is provided, the existing catalog is linked to the account. If `name` is provided without `catalog_id`, a new catalog is created. If both are provided, `catalog_id` takes priority. - diff --git a/api-reference/songs/catalogs-delete.mdx b/api-reference/songs/catalogs-delete.mdx deleted file mode 100644 index 97547067..00000000 --- a/api-reference/songs/catalogs-delete.mdx +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Delete Catalogs -openapi: delete /api/catalogs ---- - - - When unlinking a catalog from an account, if no other accounts remain linked to the catalog, the catalog is automatically deleted (cascading to catalog_songs). Otherwise, only the account-catalog relationship is removed. - diff --git a/api-reference/songs/catalogs.mdx b/api-reference/songs/catalogs.mdx index 357d672d..eae6d4b2 100644 --- a/api-reference/songs/catalogs.mdx +++ b/api-reference/songs/catalogs.mdx @@ -1,8 +1,4 @@ --- title: Get Catalogs -openapi: get /api/catalogs +openapi: "/api-reference/openapi/releases.json GET /api/accounts/{id}/catalogs" --- - - - The Catalogs API also supports POST for creating/linking catalogs and DELETE for unlinking catalogs. See the [Create Catalogs](/api-reference/songs/catalogs-create) and [Delete Catalogs](/api-reference/songs/catalogs-delete) endpoints. - diff --git a/docs.json b/docs.json index 997442ca..f9c0c005 100644 --- a/docs.json +++ b/docs.json @@ -158,8 +158,6 @@ "api-reference/songs/analyze", "api-reference/songs/analyze-presets", "api-reference/songs/catalogs", - "api-reference/songs/catalogs-create", - "api-reference/songs/catalogs-delete", "api-reference/songs/catalog-songs", "api-reference/songs/catalog-songs-add", "api-reference/songs/catalog-songs-delete"