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

# Create communication message

> Create a message, reply, internal note, system event, or review event inside a communication thread. Use parent_message_id for a reply to a specific message.



## OpenAPI

````yaml POST /communication/threads/{id}/messages
openapi: 3.0.1
info:
  title: Masivo's REST API
  description: Learn how to use Masivo's REST API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.masivo.ai/api/storefront/v1
security:
  - bearerAuth: []
paths:
  /communication/threads/{id}/messages:
    post:
      description: >-
        Create a message, reply, internal note, system event, or review event
        inside a communication thread. Use parent_message_id for a reply to a
        specific message.
      parameters:
        - in: header
          name: x-account-id
          description: The account that owns the communication thread
          required: true
          schema:
            type: string
            format: uuid
        - in: path
          name: id
          description: The communication thread id
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommunicationMessageCreate'
      responses:
        '201':
          description: Communication message created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/CommunicationMessage'
        '400':
          description: Message creation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Invalid request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CommunicationMessageCreate:
      type: object
      required:
        - direction
      properties:
        parent_message_id:
          type: string
          format: uuid
          nullable: true
        external_message_id:
          type: string
          nullable: true
        direction:
          $ref: '#/components/schemas/CommunicationDirection'
        message_type:
          $ref: '#/components/schemas/CommunicationMessageType'
        channel:
          $ref: '#/components/schemas/CommunicationChannel'
        sender_type:
          $ref: '#/components/schemas/CommunicationSenderType'
        sender_user_id:
          type: string
          format: uuid
          nullable: true
        sender_customer_id:
          type: string
          nullable: true
        sender_email:
          type: string
          format: email
          nullable: true
        sender_display_name:
          type: string
          nullable: true
        recipient_actor_ids:
          type: array
          items:
            type: object
            additionalProperties: true
        subject:
          type: string
          nullable: true
        body_text:
          type: string
          nullable: true
        body_html:
          type: string
          nullable: true
        attachments:
          type: array
          items:
            type: object
            additionalProperties: true
        raw_payload:
          type: object
          additionalProperties: true
        sent_at:
          type: string
          format: date-time
          nullable: true
        delivered_at:
          type: string
          format: date-time
          nullable: true
        read_at:
          type: string
          format: date-time
          nullable: true
        failed_at:
          type: string
          format: date-time
          nullable: true
        status:
          type: string
          enum:
            - queued
            - sent
            - delivered
            - read
            - failed
            - received
          nullable: true
    CommunicationMessage:
      type: object
      properties:
        id:
          type: string
          format: uuid
        account_id:
          type: string
          format: uuid
        thread_id:
          type: string
          format: uuid
        parent_message_id:
          type: string
          format: uuid
          nullable: true
        external_message_id:
          type: string
          nullable: true
        direction:
          $ref: '#/components/schemas/CommunicationDirection'
        message_type:
          $ref: '#/components/schemas/CommunicationMessageType'
        channel:
          $ref: '#/components/schemas/CommunicationChannel'
        sender_type:
          $ref: '#/components/schemas/CommunicationSenderType'
        sender_user_id:
          type: string
          format: uuid
          nullable: true
        sender_customer_id:
          type: string
          nullable: true
        sender_email:
          type: string
          format: email
          nullable: true
        sender_display_name:
          type: string
          nullable: true
        recipient_actor_ids:
          type: array
          items:
            type: object
            additionalProperties: true
        subject:
          type: string
          nullable: true
        body_text:
          type: string
          nullable: true
        body_html:
          type: string
          nullable: true
        attachments:
          type: array
          items:
            type: object
            additionalProperties: true
        raw_payload:
          type: object
          additionalProperties: true
        sent_at:
          type: string
          format: date-time
          nullable: true
        delivered_at:
          type: string
          format: date-time
          nullable: true
        read_at:
          type: string
          format: date-time
          nullable: true
        failed_at:
          type: string
          format: date-time
          nullable: true
        status:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        deleted_at:
          type: string
          format: date-time
          nullable: true
    Error:
      required:
        - error
        - details
      type: object
      properties:
        error:
          type: string
        details:
          type: string
    CommunicationDirection:
      type: string
      enum:
        - inbound
        - outbound
        - internal
        - system
    CommunicationMessageType:
      type: string
      enum:
        - message
        - reply
        - internal_note
        - system_event
        - review_event
    CommunicationChannel:
      type: string
      enum:
        - email
        - whatsapp
        - chat
        - review
        - system
        - other
    CommunicationSenderType:
      type: string
      enum:
        - customer
        - agent
        - system
        - integration
        - email
        - unknown
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````