---
title: "POST /assistants/{assistantId}/sessions/{sessionId}/message"
method: POST
path: "/assistants/{assistantId}/sessions/{sessionId}/message"
---

# POST /assistants/{assistantId}/sessions/{sessionId}/message

`POST /assistants/{assistantId}/sessions/{sessionId}/message`

Submits a message to the Amazon Q in Connect session.

## Path parameters

- `assistantId` string, required
- `sessionId` string, required

## Request body

- object
  - `type` 'TEXT' | 'TOOL_USE_RESULT', required — The message type.
  - `message` object, required — The message input.
    - `value` object — The message input value.
      - `text` object — The message data in text type.
        - `value` string, password — The value of the message data in text type.
        - `citations` Citation[] — The citations associated with the text message.
          - `contentId` string — The identifier of the content being cited.
          - `title` string, password — The title of the cited content.
          - `knowledgeBaseId` string — The identifier of the knowledge base containing the cited content.
          - `citationSpan` CitationSpan, required — Contains information about where the text with a citation begins and ends in the generated output.
            - `beginOffsetInclusive` integer — Where the text with a citation starts in the generated output.
            - `endOffsetExclusive` integer — Where the text with a citation ends in the generated output.
          - `sourceURL` string, password — The source URL for the citation.
          - `referenceType` 'WEB_CRAWLER' | 'KNOWLEDGE_BASE' | 'BEDROCK_KB_S3' | 'BEDROCK_KB_WEB' | 'BEDROCK_KB_CONFLUENCE' | 'BEDROCK_KB_SALESFORCE' | 'BEDROCK_KB_SHAREPOINT' | 'BEDROCK_KB_KENDRA' | 'BEDROCK_KB_CUSTOM_DOCUMENT' | 'BEDROCK_KB_SQL', required — A type to define the KB origin of a cited content
        - `aiGuardrailAssessment` object — The AI Guardrail assessment for the text message.
          - `blocked` boolean, required — Indicates whether the AI Guardrail blocked the content.
      - `toolUseResult` object — The result of tool usage in the message.
        - `toolUseId` string, required — The identifier of the tool use instance.
        - `toolName` string, required — The name of the tool that was used.
        - `toolResult` object, required — The result of the tool usage.
        - `inputSchema` object — The input schema for the tool use result.
  - `aiAgentId` string — The identifier of the AI Agent to use for processing the message.
  - `conversationContext` object — The conversation context to include in SendMessage.
    - `selfServiceConversationHistory` SelfServiceConversationHistory[] — The self service conversation history before the Amazon Q in Connect session.
      - `turnNumber` integer — The number of turn of the conversation history data.
      - `inputTranscript` string, password — The input transcript of the conversation history data.
      - `botResponse` string, password — The bot response of the conversation history data.
      - `timestamp` string, date-time — The timestamp of the conversation history entry.
  - `configuration` object — The configuration for a <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_amazon-q-connect_SendMessage.html">SendMessage</a> request.
    - `generateFillerMessage` boolean — Generates a filler response when tool selection is <code>QUESTION</code>.
    - `generateChunkedMessage` boolean — Configuration for generating chunked messages.
  - `clientToken` string — A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the AWS SDK populates this field.For more information about idempotency, see Making retries safe with idempotent APIs.
  - `orchestratorUseCase` string — The orchestrator use case for message processing.
  - `metadata` object — Additional metadata for the message.
  - `originRequestId` string — Request identifier from the origin system, used for end-to-end tracing across spans.

## Response `200`

Success

- SendMessageResponse
  - `requestMessageId` string, required — The identifier of the submitted message.
  - `configuration` object — The configuration of the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_amazon-q-connect_SendMessage.html">SendMessage</a> request.
    - `generateFillerMessage` boolean — Generates a filler response when tool selection is <code>QUESTION</code>.
    - `generateChunkedMessage` boolean — Configuration for generating chunked messages.
  - `nextMessageToken` string, required — The token for the next message, used by GetNextMessage.

## Other responses

- `480` — RequestTimeoutException
- `481` — ValidationException
- `482` — ConflictException
- `483` — ServiceQuotaExceededException
- `484` — DependencyFailedException
- `485` — AccessDeniedException
- `486` — ResourceNotFoundException
- `487` — ThrottlingException

---

[API](https://skmtc.net/aws/apis/qconnect.md) · [All operations](https://skmtc.net/aws/apis/qconnect/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/qconnect/revisions/833f5de92023/schema)
