From 6f4a0a159a1ae60b0e4e3855bf2ddb24670b5a2d Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Sun, 21 Jun 2026 19:15:52 -0500 Subject: [PATCH 1/5] docs: account_id override for DELETE /api/artists/{id} and GET /api/chats/{id}/messages Documents the optional admin/org account_id override on two account-scoped endpoints (chat#1811): - DELETE /api/artists/{id}: optional account_id request body + 400 for invalid UUID - GET /api/chats/{id}/messages: optional account_id query param (accountId alias) + 400 Co-Authored-By: Claude Opus 4.8 (1M context) --- api-reference/openapi/releases.json | 30 ++++++++++++++++++++++++++++- api-reference/openapi/research.json | 14 ++++++++++++-- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/api-reference/openapi/releases.json b/api-reference/openapi/releases.json index 42867501..66a1276b 100644 --- a/api-reference/openapi/releases.json +++ b/api-reference/openapi/releases.json @@ -805,7 +805,7 @@ } }, "delete": { - "description": "Delete an artist accessible to the authenticated account. This removes the caller's direct artist link and, if no owner links remain, deletes the artist account itself.", + "description": "Delete an artist accessible to the authenticated account. This removes the caller's direct artist link and, if no owner links remain, deletes the artist account itself. Optionally accepts an account_id override so a caller with access to multiple accounts can delete an artist in another account's context.", "parameters": [ { "name": "id", @@ -818,6 +818,24 @@ } } ], + "requestBody": { + "description": "Optional account context override.", + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "account_id": { + "type": "string", + "format": "uuid", + "description": "UUID of the account whose artist should be deleted. Only applicable when the authenticated account has access to multiple accounts via organization membership or Recoup admin access. If not provided, the deletion runs in the API key's own account context." + } + } + } + } + } + }, "responses": { "200": { "description": "Artist deleted successfully", @@ -829,6 +847,16 @@ } } }, + "400": { + "description": "Bad request - account_id is not a valid UUID", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteArtistErrorResponse" + } + } + } + }, "401": { "description": "Unauthorized - missing or invalid authentication" }, diff --git a/api-reference/openapi/research.json b/api-reference/openapi/research.json index f149a2d0..8916e6a6 100644 --- a/api-reference/openapi/research.json +++ b/api-reference/openapi/research.json @@ -332,7 +332,7 @@ }, "/api/chats/{id}/messages": { "get": { - "description": "Retrieve all messages (memories) for a specific chat room in chronological order.", + "description": "Retrieve all messages (memories) for a specific chat room in chronological order. Optionally accepts an account_id query override so a caller with access to multiple accounts can read another account's chat messages.", "parameters": [ { "name": "id", @@ -343,6 +343,16 @@ "type": "string", "format": "uuid" } + }, + { + "name": "account_id", + "in": "query", + "description": "Read messages in the context of a specific account. Only applicable when the authenticated account has access to multiple accounts via organization membership or Recoup admin access. The camelCase alias accountId is also accepted. If not provided, access is resolved against the API key's own account.", + "required": false, + "schema": { + "type": "string", + "format": "uuid" + } } ], "responses": { @@ -357,7 +367,7 @@ } }, "400": { - "description": "Bad request - invalid chat id", + "description": "Bad request - invalid chat id or account_id", "content": { "application/json": { "schema": { From b4ee5e72e1becc571dc65fabb1f13f2fcce0cabc Mon Sep 17 00:00:00 2001 From: "sweetman.eth" Date: Tue, 23 Jun 2026 06:42:46 -0500 Subject: [PATCH 2/5] Update api-reference/openapi/releases.json --- api-reference/openapi/releases.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-reference/openapi/releases.json b/api-reference/openapi/releases.json index 66a1276b..4f739c5b 100644 --- a/api-reference/openapi/releases.json +++ b/api-reference/openapi/releases.json @@ -805,7 +805,7 @@ } }, "delete": { - "description": "Delete an artist accessible to the authenticated account. This removes the caller's direct artist link and, if no owner links remain, deletes the artist account itself. Optionally accepts an account_id override so a caller with access to multiple accounts can delete an artist in another account's context.", + "description": "Delete an artist accessible to the authenticated account. This removes the caller's direct artist link and, if no owner links remain, deletes the artist account itself.", "parameters": [ { "name": "id", From ab53f80395aa68a2ce9b3475f5fc3d6d5e454068 Mon Sep 17 00:00:00 2001 From: "sweetman.eth" Date: Tue, 23 Jun 2026 06:43:00 -0500 Subject: [PATCH 3/5] Update api-reference/openapi/research.json --- api-reference/openapi/research.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-reference/openapi/research.json b/api-reference/openapi/research.json index 8916e6a6..26539d19 100644 --- a/api-reference/openapi/research.json +++ b/api-reference/openapi/research.json @@ -332,7 +332,7 @@ }, "/api/chats/{id}/messages": { "get": { - "description": "Retrieve all messages (memories) for a specific chat room in chronological order. Optionally accepts an account_id query override so a caller with access to multiple accounts can read another account's chat messages.", + "description": "Retrieve all messages (memories) for a specific chat room in chronological order.", "parameters": [ { "name": "id", From 5a7152366e58fb75110630d8303c3be55aede92a Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Tue, 23 Jun 2026 06:46:12 -0500 Subject: [PATCH 4/5] docs(chats/messages): drop camelCase account_id alias to match query-param convention Query params across the API and docs use snake_case account_id only (10 handlers, all existing account_id query params). Removing the camelCase accountId alias and tightening the description per review. Co-Authored-By: Claude Opus 4.8 (1M context) --- api-reference/openapi/research.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-reference/openapi/research.json b/api-reference/openapi/research.json index 26539d19..94563cdf 100644 --- a/api-reference/openapi/research.json +++ b/api-reference/openapi/research.json @@ -347,7 +347,7 @@ { "name": "account_id", "in": "query", - "description": "Read messages in the context of a specific account. Only applicable when the authenticated account has access to multiple accounts via organization membership or Recoup admin access. The camelCase alias accountId is also accepted. If not provided, access is resolved against the API key's own account.", + "description": "Read messages in the context of a specific account. Only applicable when the authenticated account has access to multiple accounts via organization membership or Recoup admin access.", "required": false, "schema": { "type": "string", From c3bf9bb430e5931a03036c2b229fa62527eda102 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Tue, 23 Jun 2026 07:04:10 -0500 Subject: [PATCH 5/5] docs: roll back account_id query param on GET /api/chats/{id}/messages The override param is redundant for this endpoint: the chat is fully identified by the path {id}, and selectRoom already resolves room.account_id, so admin access should be handled by an admin-aware access check in validateChatAccess (RECOUP_ORG bypass), not by an extra query param the caller would have to supply. Keeps the DELETE /api/artists/{id} body override, where the param is load-bearing (it names whose ownership link to drop). Refs recoupable/chat#1811 Co-Authored-By: Claude Opus 4.8 (1M context) --- api-reference/openapi/research.json | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/api-reference/openapi/research.json b/api-reference/openapi/research.json index 94563cdf..f149a2d0 100644 --- a/api-reference/openapi/research.json +++ b/api-reference/openapi/research.json @@ -343,16 +343,6 @@ "type": "string", "format": "uuid" } - }, - { - "name": "account_id", - "in": "query", - "description": "Read messages in the context of a specific account. Only applicable when the authenticated account has access to multiple accounts via organization membership or Recoup admin access.", - "required": false, - "schema": { - "type": "string", - "format": "uuid" - } } ], "responses": { @@ -367,7 +357,7 @@ } }, "400": { - "description": "Bad request - invalid chat id or account_id", + "description": "Bad request - invalid chat id", "content": { "application/json": { "schema": {