From 16e46ae4634c6110b22ba65d5148361a36a5df92 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Thu, 4 Jun 2026 13:16:56 -0700 Subject: [PATCH 1/2] docs: document messageId and idempotency in Chat API (#11012) Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> --- .../reference/embed-apis/chat-api.mdx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs-mintlify/reference/embed-apis/chat-api.mdx b/docs-mintlify/reference/embed-apis/chat-api.mdx index ab2ae916f8d55..c8fc04a39f704 100644 --- a/docs-mintlify/reference/embed-apis/chat-api.mdx +++ b/docs-mintlify/reference/embed-apis/chat-api.mdx @@ -82,6 +82,7 @@ while (true) { |-------|------|----------|-------------| | `input` | string | No | The user's message or question. If omitted returns current state of thread with provided chatId. | | `chatId` | string | No | Chat thread ID. If omitted, a new thread is created automatically. If provided, it should match the previously returned `chatId` from a message with id `__cutoff__` sent as the `state.chatId` field. | +| `messageId` | string | No | Client-provided identifier for the user message. Must match the format `-message` (a 13+ digit Unix timestamp in milliseconds followed by `-message`), e.g. `1717500000000-message`. Used to make requests idempotent — see [Idempotency](#idempotency). | | `sessionSettings.externalId` | string | No | Unique identifier for the external user, lowercase and without spaces. Either `externalId` or `internalId` should be provided. | | `sessionSettings.internalId` | string | No | Email address of an internal Cube Cloud user. Either `externalId` or `internalId` should be provided. | | `sessionSettings.email` | string | No | User's email address | @@ -156,6 +157,7 @@ Copy the complete Chat API URL from your agent settings (**Chat API URL** field) - **`input`** (string): User message or query to send to the AI agent, e.g. "What is our revenue last month?". If omitted, returns current state of thread with provided `chatId`. - **`chatId`** (string): Chat thread ID. If omitted, a new thread is created automatically. If provided, it should match the previously returned `chatId` from a message with id `__cutoff__`. +- **`messageId`** (string): Client-provided identifier for the user message. Must match the format `-message` (a 13+ digit Unix timestamp in milliseconds followed by `-message`), e.g. `1717500000000-message`. Used to make requests idempotent — see [Idempotency](#idempotency). - **`sessionSettings`** (object, required): Session configuration for the user - **`externalId`** (string): Unique identifier for the external user. Either `externalId` or `internalId` should be provided. - **`internalId`** (string): Email address of an internal Cube Cloud user. The user must already exist. Either `externalId` or `internalId` should be provided. @@ -166,6 +168,23 @@ Copy the complete Chat API URL from your agent settings (**Chat API URL** field) - **`activeBranchName`** (string): Name of a development branch to use for the chat session. When provided, queries run against the specified branch instead of the main branch. - **`isDefaultBranch`** (boolean): Whether the specified `activeBranchName` is the default branch. Defaults to `true` when `activeBranchName` is not set, and `false` when it is. Set to `true` if passing the main/production branch name. +## Idempotency + +You can pass a client-provided `messageId` in the request body to make Chat API +requests idempotent. The value must match the format `-message`, +where `` is a Unix timestamp in milliseconds with 13 or more digits, +e.g. `1717500000000-message`. + +If a request with the same `messageId` arrives while a stream for that message +is still active on the thread, the API resubscribes the new request to the +existing stream instead of starting a new one. This is useful for retrying +after a dropped connection: the client can replay the same request and resume +receiving the stream from the current point without producing duplicate +assistant messages. + +Without a matching `messageId`, sending a new message to a thread that is +already streaming returns a `Streaming for thread is in progress` error. + ## Response Format From b350fedb57d48b86d3c29c8c7064783274bb7cc5 Mon Sep 17 00:00:00 2001 From: Artyom Keydunov Date: Thu, 4 Jun 2026 15:36:06 -0700 Subject: [PATCH 2/2] docs: add Demos link to navbar (#11014) Add a "Demos" link pointing to https://cube.dev/demos in the docs top navbar so it is always visible across all documentation pages. Co-authored-by: Claude Opus 4.8 --- docs-mintlify/docs.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs-mintlify/docs.json b/docs-mintlify/docs.json index e4de92640acd6..e0a5982ec2088 100644 --- a/docs-mintlify/docs.json +++ b/docs-mintlify/docs.json @@ -684,6 +684,10 @@ }, "navbar": { "links": [ + { + "label": "Demos", + "href": "https://cube.dev/demos" + }, { "label": "Changelog", "href": "https://cube.dev/changelog"