From 8b8fa7e586965eca4866cd916edb19eff59ab869 Mon Sep 17 00:00:00 2001 From: Arpit Gupta Date: Tue, 31 Mar 2026 01:02:40 +0530 Subject: [PATCH 1/5] docs: add get chat segment endpoint reference --- api-reference/chat/segment.mdx | 4 ++ api-reference/openapi.json | 112 +++++++++++++++++++++++++++++++++ docs.json | 3 +- 3 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 api-reference/chat/segment.mdx diff --git a/api-reference/chat/segment.mdx b/api-reference/chat/segment.mdx new file mode 100644 index 0000000..c320ce2 --- /dev/null +++ b/api-reference/chat/segment.mdx @@ -0,0 +1,4 @@ +--- +title: "Get Chat Segment" +openapi: get /api/chats/{id}/segment +--- diff --git a/api-reference/openapi.json b/api-reference/openapi.json index 8fea02f..2174008 100644 --- a/api-reference/openapi.json +++ b/api-reference/openapi.json @@ -1245,6 +1245,65 @@ } } }, + "/api/chats/{id}/segment": { + "get": { + "description": "Retrieve the segment associated with a specific chat room. Returns 404 if the chat does not exist or is not accessible by the authenticated caller.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The unique identifier (UUID) of the chat room.", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "Chat segment resolved successfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetChatSegmentResponse" + } + } + } + }, + "400": { + "description": "Bad request - invalid chat id", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetChatSegmentErrorResponse" + } + } + } + }, + "401": { + "description": "Unauthorized - invalid or missing credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "404": { + "description": "Not found - chat does not exist or is not accessible", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetChatSegmentErrorResponse" + } + } + } + } + } + } + }, "/api/chats/compact": { "post": { "description": "Compact one or more chat conversations into summarized versions. This reduces the size of chat history while preserving key information. Optionally provide a prompt to control what information gets preserved in the compacted summary.", @@ -6436,6 +6495,59 @@ } } }, + "GetChatSegmentResponse": { + "type": "object", + "required": [ + "status", + "room_id", + "segment_id", + "segment_exists" + ], + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ], + "description": "Status of the request" + }, + "room_id": { + "type": "string", + "format": "uuid", + "description": "UUID of the chat room" + }, + "segment_id": { + "type": "string", + "format": "uuid", + "nullable": true, + "description": "UUID of the segment associated with the chat, or null when no segment is linked" + }, + "segment_exists": { + "type": "boolean", + "description": "Whether a segment is linked to the chat room" + } + } + }, + "GetChatSegmentErrorResponse": { + "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" + } + } + }, "CreateChatRequest": { "type": "object", "properties": { diff --git a/docs.json b/docs.json index 9a686e2..3795374 100644 --- a/docs.json +++ b/docs.json @@ -45,6 +45,7 @@ "group": "Chat", "pages": [ "api-reference/chat/chats", + "api-reference/chat/segment", "api-reference/chat/create", "api-reference/chat/update", "api-reference/chat/generate", @@ -323,4 +324,4 @@ "og:site_name": "Recoup", "twitter:card": "summary_large_image" } -} \ No newline at end of file +} From 9f1c803573651a931c8a52f1c14aed67c4ab0097 Mon Sep 17 00:00:00 2001 From: Arpit Gupta Date: Tue, 31 Mar 2026 01:03:37 +0530 Subject: [PATCH 2/5] docs: fix openapi frontmatter for chat segment page --- api-reference/chat/segment.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-reference/chat/segment.mdx b/api-reference/chat/segment.mdx index c320ce2..02d1e43 100644 --- a/api-reference/chat/segment.mdx +++ b/api-reference/chat/segment.mdx @@ -1,4 +1,4 @@ --- title: "Get Chat Segment" -openapi: get /api/chats/{id}/segment +openapi: "GET /api/chats/{id}/segment" --- From 285fbc133e5f26f28eb378cccf1161f8d48a2031 Mon Sep 17 00:00:00 2001 From: Arpit Gupta Date: Tue, 31 Mar 2026 01:07:57 +0530 Subject: [PATCH 3/5] docs: normalize segment openapi frontmatter method casing --- api-reference/chat/segment.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-reference/chat/segment.mdx b/api-reference/chat/segment.mdx index 02d1e43..61ebebf 100644 --- a/api-reference/chat/segment.mdx +++ b/api-reference/chat/segment.mdx @@ -1,4 +1,4 @@ --- title: "Get Chat Segment" -openapi: "GET /api/chats/{id}/segment" +openapi: "get /api/chats/{id}/segment" --- From e754f1f6697d1aade6acd3bb4fbd2a1401c0e326 Mon Sep 17 00:00:00 2001 From: Arpit Gupta Date: Tue, 31 Mar 2026 01:59:03 +0530 Subject: [PATCH 4/5] docs: switch segment openapi frontmatter to standard style --- api-reference/chat/segment.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-reference/chat/segment.mdx b/api-reference/chat/segment.mdx index 61ebebf..c320ce2 100644 --- a/api-reference/chat/segment.mdx +++ b/api-reference/chat/segment.mdx @@ -1,4 +1,4 @@ --- title: "Get Chat Segment" -openapi: "get /api/chats/{id}/segment" +openapi: get /api/chats/{id}/segment --- From 258735fddbd6513a8e01c18f6c6067901ba294a0 Mon Sep 17 00:00:00 2001 From: Arpit Gupta Date: Tue, 31 Mar 2026 02:27:49 +0530 Subject: [PATCH 5/5] fix: resolve chat segment openapi selector binding --- api-reference/chat/segment.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api-reference/chat/segment.mdx b/api-reference/chat/segment.mdx index c320ce2..5ef6ce9 100644 --- a/api-reference/chat/segment.mdx +++ b/api-reference/chat/segment.mdx @@ -1,4 +1,4 @@ --- title: "Get Chat Segment" -openapi: get /api/chats/{id}/segment +openapi: "/api-reference/openapi.json GET /api/chats/{id}/segment" ---