From f96c3b7f81b9d6f74c8b7f2e14620906a4e9c374 Mon Sep 17 00:00:00 2001 From: Arpit Gupta Date: Mon, 30 Mar 2026 21:30:18 +0530 Subject: [PATCH 1/2] docs: add DELETE /api/chats reference --- api-reference/chat/delete.mdx | 4 + api-reference/openapi.json | 135 ++++++++++++++++++++++++++++++++++ docs.json | 3 +- 3 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 api-reference/chat/delete.mdx diff --git a/api-reference/chat/delete.mdx b/api-reference/chat/delete.mdx new file mode 100644 index 0000000..2818761 --- /dev/null +++ b/api-reference/chat/delete.mdx @@ -0,0 +1,4 @@ +--- +title: 'Delete Chat' +openapi: delete /api/chats +--- diff --git a/api-reference/openapi.json b/api-reference/openapi.json index 8fea02f..ade1a76 100644 --- a/api-reference/openapi.json +++ b/api-reference/openapi.json @@ -1243,6 +1243,82 @@ } } } + }, + "delete": { + "description": "Delete a chat room by ID. This operation also removes related room records (memory emails, memories, room-report links, and segment-room links) before deleting the room itself.", + "requestBody": { + "description": "Chat deletion parameters", + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteChatRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Chat deleted successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteChatResponse" + } + } + } + }, + "400": { + "description": "Bad request - invalid parameters or validation error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteChatErrorResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - invalid or missing API key", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "403": { + "description": "Forbidden - API key does not have access to this chat", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "404": { + "description": "Not found - chat room does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteChatErrorResponse" + } + } + } + }, + "500": { + "description": "Server error - failed to delete chat", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeleteChatErrorResponse" + } + } + } + } + } } }, "/api/chats/compact": { @@ -6560,6 +6636,65 @@ } } }, + "DeleteChatRequest": { + "type": "object", + "required": [ + "chatId" + ], + "properties": { + "chatId": { + "type": "string", + "format": "uuid", + "description": "The unique identifier (UUID) of the chat room to delete." + } + } + }, + "DeleteChatResponse": { + "type": "object", + "required": [ + "status", + "chatId", + "message" + ], + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ], + "description": "Status of the request" + }, + "chatId": { + "type": "string", + "format": "uuid", + "description": "The UUID of the deleted chat room." + }, + "message": { + "type": "string", + "description": "Success message describing the deletion result." + } + } + }, + "DeleteChatErrorResponse": { + "type": "object", + "required": [ + "status", + "error" + ], + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ], + "description": "Status of the request" + }, + "error": { + "type": "string", + "description": "Error message describing what went wrong." + } + } + }, "UIMessage": { "type": "object", "description": "A message in the chat conversation. See https://ai-sdk.dev/docs/reference/ai-sdk-core/ui-message for details.", diff --git a/docs.json b/docs.json index 9a686e2..048f25b 100644 --- a/docs.json +++ b/docs.json @@ -47,6 +47,7 @@ "api-reference/chat/chats", "api-reference/chat/create", "api-reference/chat/update", + "api-reference/chat/delete", "api-reference/chat/generate", "api-reference/chat/stream", "api-reference/chat/compact" @@ -323,4 +324,4 @@ "og:site_name": "Recoup", "twitter:card": "summary_large_image" } -} \ No newline at end of file +} From ee47a45ba6791612b7bdab2014e24b3e8656e3cb Mon Sep 17 00:00:00 2001 From: Arpit Gupta Date: Mon, 30 Mar 2026 21:39:04 +0530 Subject: [PATCH 2/2] docs: use id field for delete chat schema --- api-reference/openapi.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api-reference/openapi.json b/api-reference/openapi.json index ade1a76..9c24bf1 100644 --- a/api-reference/openapi.json +++ b/api-reference/openapi.json @@ -6639,10 +6639,10 @@ "DeleteChatRequest": { "type": "object", "required": [ - "chatId" + "id" ], "properties": { - "chatId": { + "id": { "type": "string", "format": "uuid", "description": "The unique identifier (UUID) of the chat room to delete." @@ -6653,7 +6653,7 @@ "type": "object", "required": [ "status", - "chatId", + "id", "message" ], "properties": { @@ -6664,7 +6664,7 @@ ], "description": "Status of the request" }, - "chatId": { + "id": { "type": "string", "format": "uuid", "description": "The UUID of the deleted chat room."