---
title: "Assistant message"
method: POST
path: "/v2/assistant/{domain}/message"
---

# Assistant message

`POST /v2/assistant/{domain}/message`

Generates a response message from the assistant for the specified domain. Compatible with AI SDK v5+.

Authenticate with an assistant API key.

## Path parameters

- `domain` string, required

## Request body

- object
  - `fp` string, required — Fingerprint identifier for tracking conversation sessions. Use `anonymous` for anonymous users or provide a unique user identifier.
  - `threadId` string — An optional identifier used to maintain conversation continuity across multiple messages. When provided, it allows the system to associate follow-up messages with the same conversation thread. The `threadId` is returned in the response as `event.threadId` when `event.type === 'finish'`.
  - `messages` object[], required — Array of messages in the conversation. Use the handleSubmit function from the @ai-sdk/react package's useChat hook to manage messages and streaming responses.
    - `id` string, required — Unique identifier for the message.
    - `role` 'system' | 'assistant' | 'user', required — The role of the message sender.
    - `createdAt` string, date-time — Timestamp when the message was created.
    - `parts` union[], required — Array of message parts. Each part has a type and type-specific fields.
      - union
        - object — Text content part.
          - `type` 'text', required
          - `text` string, required
        - object — Reasoning content part with optional provider metadata.
          - `type` 'reasoning', required
          - `text` string, required
          - `providerMetadata` object — Optional provider-specific metadata.
        - object — Source URL reference part.
          - `type` 'source-url', required
          - `sourceId` string, required
          - `url` string, required
          - `title` string
          - `providerMetadata` object — Optional provider-specific metadata.
        - object — File attachment part.
          - `type` 'file', required
          - `mediaType` string, required
          - `url` string, required
          - `filename` string
        - object — Marks the start of a new step.
          - `type` 'step-start', required
    - `metadata` object — Optional metadata associated with the message.
  - `retrievalPageSize` number — Number of documentation search results to use for generating the response. Higher values provide more context but may increase response time. Recommended: 5.
  - `filter` object — Optional filter criteria for the search.
    - `version` string — Optional version filter.
    - `language` string — Optional language filter.
    - `groups` string[] — Optional array of group identifiers to filter results.
  - `context` object[] — Optional array of contextual information to provide to the assistant.
    - `type` 'code' | 'textSelection', required — The type of context being provided.
    - `value` string, required — The code snippet or selected text content.
    - `path` string — Optional path to the source file or page.
    - `elementId` string — Optional identifier for the UI element containing the context.
  - `currentPath` string — The path of the page the user is currently viewing. When provided, the assistant uses this context to provide more relevant answers. Maximum length: 200 characters.

## Response `200`

Message generated successfully

- object — Streaming response compatible with AI SDK v5. Use the [useChat hook from @ai-sdk/react](https://ai-sdk.dev/docs/reference/ai-sdk-ui/use-chat#usechat) to handle the response stream.

---

[API](https://skmtc.dev/mcp-b/apis/mintlify-admin-api.md) · [All operations](https://skmtc.dev/mcp-b/apis/mintlify-admin-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mcp-b/mintlify-admin-api/revisions/6165028f8792/schema)
