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

# Create Message



## OpenAPI

````yaml post /v1/threads/{thread_id}/messages
openapi: 3.1.0
info:
  title: WxO Server API
  summary: API for the next gen watsonx Orchestrate stack
  description: >+

    The watsonx Orchestrate Server provides a set of APIs to power the watsonx
    Orchestrate AI assistant. This includes the following core services:


    * Orchestrate Assistant - a built-in AI assistant that powers the
    Orchestrate end-user experience.

    * Custom Assistants - a service layer for interacting with existing AI
    assistatns (such as those in watsonx Assistant).

    * Message Threads - a chat history and async message tracking store.

    * Document Store - manage collections of documents in nearly any format
    including text, pdf, html and many more.

    * Information Extraction - automatically extract clean text and images from
    any document in the Document Store.  Also extract other useful metadata like
    questions answered, keywords, and named entities.

    * Embedding - generate vector embeddings for text and images in the Document
    Store.

    * Vector Index and Retrieval - automatically index documents with rich
    metadata for vector search or hybrid search.

    * Search Engine - create a Gen AI powered search engine that works like Bing
    or Google.

    * Query Engine - configure your own RAG (Retrieval Augmented Generation)
    engine supporting advanced retrieval patterns and automated data management.

    * Model Proxy - create your own LLM model endpoints for chat completions and
    embeddings.  Supports IBM watsonx.ai, IBM BAM, OpenAI, MistralAI, or Ollama
    for local models.


    WxO API Server utilizes the following open source projects:


    * [PostgreSQL](https://www.postgresql.org/)

    * [PGVector](https://github.com/pgvector/pgvector)

    * [LlamaIndex](https://docs.llamaindex.ai/en/stable/)

    * [LangChain](https://python.langchain.com/docs/get_started/introduction)

    * [FastAPI](https://fastapi.tiangolo.com/)

    * [Unstructured](https://unstructured.io/)

    * [Celery](https://docs.celeryproject.org/en/stable/)

  version: 0.1.0
servers:
  - url: https://{api_endpoint}
    description: version
security: []
paths:
  /v1/threads/{thread_id}/messages:
    post:
      tags:
        - Message Threads
      summary: Create Message
      operationId: Create_Message_v1_threads__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/CreateMessage'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    CreateMessage:
      properties:
        role:
          type: string
          title: Role
        content:
          anyOf:
            - items:
                $ref: '#/components/schemas/AssistantContent'
              type: array
            - type: string
          title: Content
        mentions:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/Mention'
                  - $ref: '#/components/schemas/AssistantMention'
              type: array
            - type: 'null'
          title: Mentions
        document_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: Document Ids
        parent_message_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Parent Message Id
        additional_properties:
          anyOf:
            - $ref: '#/components/schemas/AdditionalProperties'
            - type: 'null'
        assistant_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Assistant Id
        context:
          anyOf:
            - $ref: '#/components/schemas/Context'
            - type: 'null'
        step_history:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Step History
        message_state:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Message State
      type: object
      required:
        - role
        - content
      title: CreateMessage
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AssistantContent:
      properties:
        response_type:
          $ref: '#/components/schemas/AssistantContentType'
        json_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Json Schema
        ui_schema:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Ui Schema
        form_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Form Data
          default: {}
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
        form_operation:
          anyOf:
            - type: string
            - type: 'null'
          title: Form Operation
        sub_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Sub Type
        event_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Type
        dps_payload_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Dps Payload Id
      additionalProperties: true
      type: object
      required:
        - response_type
      title: AssistantContent
    Mention:
      properties:
        type:
          type: string
          title: Type
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
      type: object
      required:
        - type
        - id
        - name
      title: Mention
    AssistantMention:
      properties:
        assistant_id:
          type: string
          format: uuid
          title: Assistant Id
        assistant_name:
          type: string
          title: Assistant Name
      type: object
      required:
        - assistant_id
        - assistant_name
      title: AssistantMention
    AdditionalProperties:
      properties:
        wxa_message:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Wxa Message
        display_properties:
          anyOf:
            - $ref: '#/components/schemas/DisplayProperties'
            - type: 'null'
        tool_calls:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          title: Tool Calls
        tool_call_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Call Id
        tool_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Tool Name
        wxo_connection_status:
          anyOf:
            - $ref: '#/components/schemas/WxoConnectionStatus'
            - type: 'null'
      type: object
      title: AdditionalProperties
    Context:
      properties:
        values:
          items:
            $ref: '#/components/schemas/ContextKV'
          type: array
          title: Values
          default: []
      type: object
      title: Context
    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
    AssistantContentType:
      type: string
      enum:
        - conversational_search
        - text
        - image
        - option
        - pause
        - iframe
        - connect_to_agent
        - suggestion
        - channel_transfer
        - search
        - user_defined
        - video
        - audio
        - date
        - inline_error
        - chat_with_docs_upload
        - disconnected_apps
        - forms
        - form_operation
        - document_processing_response
      title: AssistantContentType
    DisplayProperties:
      properties:
        skip_render:
          type: boolean
          title: Skip Render
          default: false
        is_async:
          type: boolean
          title: Is Async
          default: false
        form_operation:
          type: string
          title: Form Operation
          default: ''
      type: object
      title: DisplayProperties
    WxoConnectionStatus:
      properties:
        connection_status:
          type: string
          title: Connection Status
        connection_message:
          type: string
          title: Connection Message
      type: object
      title: WxoConnectionStatus
    ContextKV:
      properties:
        key:
          type: string
          title: Key
        value:
          title: Value
      type: object
      required:
        - key
      title: ContextKV
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````