> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cattix.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Chat Thread Message

> Create a message in the chat thread with the given ID.

Args:
    thread_id (str): The `.thread_id` of the chat thread
    message (AssistantChatMessageCreateSchema): The message to create
    approved_user (User): The current user

Returns:
    Dict containing the created message



## OpenAPI

````yaml https://dev-api.cattix.com/openapi.json post /api/v1/chat/{thread_id}/messages
openapi: 3.1.0
info:
  title: CATTIX API
  description: CATTIX Backend API
  version: 0.107.0
servers:
  - url: http://localhost:8000
    description: Local
  - url: https://dev-api.cattix.com
    description: Development
  - url: https://staging-api.cattix.com
    description: Staging
  - url: https://api.cattix.com
    description: Production
security: []
paths:
  /api/v1/chat/{thread_id}/messages:
    post:
      tags:
        - Chat
      summary: Create Chat Thread Message
      description: |-
        Create a message in the chat thread with the given ID.

        Args:
            thread_id (str): The `.thread_id` of the chat thread
            message (AssistantChatMessageCreateSchema): The message to create
            approved_user (User): The current user

        Returns:
            Dict containing the created message
      operationId: create_chat_thread_message_api_v1_chat__thread_id__messages_post
      parameters:
        - name: thread_id
          in: path
          required: true
          schema:
            type: string
            title: Thread Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssistantChatMessageCreateSchema'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AssistantChatMessageSchema'
                title: >-
                  Response Create Chat Thread Message Api V1 Chat  Thread Id 
                  Messages Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    AssistantChatMessageCreateSchema:
      properties:
        role:
          type: string
          title: The role of the chat message
        content:
          type: string
          title: The content of the chat message to create
      type: object
      required:
        - role
        - content
      title: AssistantChatMessageCreateSchema
      description: The schema for creating an assistant's chat message.
    AssistantChatMessageSchema:
      properties:
        role:
          type: string
          title: The role of the chat message
        content:
          type: string
          title: The content of the chat message
        frontend_actions:
          items:
            $ref: '#/components/schemas/FrontendAction'
          type: array
          title: The actions to be performed by the frontend
          default: []
        date_added:
          type: string
          format: date-time
          title: The date the chat message was added
        date_updated:
          type: string
          format: date-time
          title: The date the chat message was updated
      type: object
      required:
        - role
        - content
        - date_added
        - date_updated
      title: AssistantChatMessageSchema
      description: The schema for an assistant's chat message.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    FrontendAction:
      type: string
      enum:
        - enable_submit_button
        - disable_submit_button
        - update_campaign_draft
        - set_campaign_draft_step_1
        - set_campaign_draft_step_2
        - set_campaign_draft_step_3
        - set_campaign_draft_step_4
      title: FrontendAction
      description: The Front-end actions.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: api/v1/users/authorization/token

````