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

# Store a new conversation

> Store a new conversation without sending any messages



## OpenAPI

````yaml https://dev.enneo.dev/api/mind/docs/open-api post /ticket/{ticketId}/conversation/store
openapi: 3.0.0
info:
  version: '1'
  title: enneo.MIND API
  description: This describes the API of enneo Mind, the main ticketing backend
  contact:
    name: enneo GmbH
    email: richard@enneo.ai
  license:
    name: Proprietary software
    url: https://enneo.ai
servers:
  - url: https://demo.enneo.ai/api/mind
    description: Production server, demo client
  - url: https://main.enneo.dev/api/mind
    description: Development main branch
  - url: http://localhost:8005/api/mind
    description: Local development server
security:
  - bearerAuth:
      - api
  - cookieAuth:
      - api
paths:
  /ticket/{ticketId}/conversation/store:
    post:
      tags:
        - Conversation
      summary: Store a new conversation
      description: Store a new conversation without sending any messages
      operationId: storeConversation
      parameters:
        - name: ticketId
          in: path
          required: true
          schema:
            type: integer
          description: The ID of the ticket to store conversation for
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                process:
                  type: string
                  enum:
                    - realtime
                    - batch
                    - 'false'
                  default: batch
                  description: >-
                    When to run AI logic for the conversation. Realtime=Run AI
                    logic synchronously, even though this will take some time,
                    Batch=Run AI logic after the conversation is created
                    asynchronously, False=Do not run AI logic at all.
                direction:
                  type: string
                  enum:
                    - in
                    - out
                    - internal
                  description: >-
                    The direction of the conversation. Out=Outgoing to customer,
                    In=Incoming from customer, Internal=Internal conversation,
                    e.g. from an internal email address from another department.
                from:
                  type: string
                  description: From email address
                  example: john@smith.com
                fromName:
                  type: string
                  description: From name
                  example: John Smith
                to:
                  type: array
                  items:
                    type: string
                  description: To email addresses
                  example:
                    - customer@web.de
                ccEmails:
                  type: array
                  items:
                    type: string
                  description: >-
                    CC email addresses (can include names with email format like
                    "Name <email@domain.com>")
                  example:
                    - Michael Jackson <michael-test123@jack.s.on.com>
                bccEmails:
                  type: array
                  items:
                    type: string
                  description: BCC email addresses
                subject:
                  type: string
                  description: Email subject line
                  example: Ticket subject
                body:
                  type: string
                  description: HTML body content
                  example: Ticket body PART 2
                bodyPlain:
                  type: string
                  description: >-
                    Optional plain text body content. If not set, the body
                    content will be used, stripped of HTML tags.
                bodyClean:
                  type: string
                  description: >-
                    Optional clean body content. This is the body content
                    without any HTML tags. If not set, the body content will be
                    used, stripped of HTML tags.
                private:
                  type: boolean
                  default: false
                  description: >-
                    Whether this is a private conversation (internal note by an
                    agent)
                  example: false
                subchannelId:
                  type: integer
                  description: >-
                    Subchannel ID. Must correspond to a subchannel in the
                    ticket's channel. A subchannel is e.g. a specific mailbox
                    (for email tickets) or a specific chat channel (for chat
                    tickets)
                  example: 4
                status:
                  type: string
                  enum:
                    - open
                    - pending
                    - closed
                  description: Ticket status
                  example: open
                createdAt:
                  type: string
                  description: >-
                    Creation timestamp (YYYY-MM-DD HH:MM:SS format) when the
                    conversation was created. If not set, the current timestamp
                    will be used.
                  example: '2024-03-01 00:00:00'
                firstResponseDueBy:
                  type: string
                  description: >-
                    Optional first response due date (YYYY-MM-DD HH:MM:SS
                    format). If set, the ticket will be updated with this first
                    response due date.
                  example: '2021-01-02 00:00:00'
                dueBy:
                  type: string
                  description: >-
                    Optional due date (YYYY-MM-DD HH:MM:SS format). If set, the
                    ticket will be updated with this due date.
                  example: '2021-01-07 00:00:00'
                attachments:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: Attachment file name
                        example: myattachment1.png
                      url:
                        type: string
                        description: URL to download the attachment from
                        example: >-
                          https://framerusercontent.com/images/n1fjKCgnztVE5RhOJBPPaCIRw.png
                      base64:
                        type: string
                        description: Base64 encoded file content (alternative to url)
                        example: base-64-encoded-string-of-attachment-file
                  description: >-
                    File attachments (either url or base64 should be provided
                    per attachment)
                externalConversationId:
                  type: string
                  description: External conversation ID for tracking
                  example: abc-123
                rawData:
                  type: object
                  description: Custom user-defined data object for additional metadata
                  example:
                    myObjectId: 123
                type:
                  type: string
                  default: html
                  description: The type of conversation
                sender:
                  type: object
                  description: Sender information
                content:
                  type: object
                  description: Conversation content
                intentIds:
                  type: array
                  items:
                    type: integer
                  description: Array of intent IDs
                crmNotificationId:
                  type: string
                  description: Optional external CRM notification ID
                contractId:
                  type: string
                  description: Contract ID
                customerId:
                  type: string
                  description: Customer ID
                agentId:
                  type: integer
                  description: Agent ID that authored the conversation
                priority:
                  type: string
                  enum:
                    - low
                    - medium
                    - high
                    - urgent
                  description: >-
                    Optional ticket priority. If set, the ticket will be updated
                    with this priority.
      responses:
        '201':
          description: Conversation created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  conversationId:
                    type: integer
                  ticketId:
                    type: integer
                  conversation:
                    $ref: '#/components/schemas/Conversation'
                  eventId:
                    type: integer
        '400':
          description: Bad request - Invalid input
        '403':
          description: Unauthorized
        '404':
          description: Ticket not found
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Conversation:
      type: object
      description: >-
        A conversation is an interaction to a ticket. Typically a reply or
        internal note to an email, or a chat message for a chat
      properties:
        id:
          type: integer
          example: 123
          description: ID of conversation
        ticketId:
          type: integer
          example: 123
        type:
          type: string
          description: Type of message
          example: html
        direction:
          type: string
          example: out
        private:
          type: boolean
          description: >-
            If true, then this conversation is a private/internal note of an
            agent
          example: false
        isDraft:
          type: boolean
          description: >-
            If true, then this conversation is a draft that requires supervisor
            approval before sending
          example: false
        fromEmail:
          deprecated: true
          type: string
          example: service@enneo.ai
        fromEmailName:
          deprecated: true
          type: string
          example: Enneo Admin
        agentId:
          deprecated: true
          type: integer
          example: 1
        sender:
          type: object
          description: Sender of the message
          properties:
            id:
              type: integer
              example: 1
            name:
              type: string
              example: Enneo Admin
            email:
              type: string
              example: example@enneo.ai
            subchannelId:
              type: integer
              nullable: true
              example: 1
              description: The subchannel ID associated with the sender
        toEmail:
          description: Only for email channel
          type: array
          items:
            type: string
            example: to@gmail.com
        to:
          description: >-
            Array of recipients. For emails, contains email addresses (e.g.
            service@enneo.ai). For letters, contains postal addresses (e.g.
            "John Smith, Smithway 1, 12345 Berlin, Germany")
          type: array
          items:
            type: string
            example: service@enneo.ai
        ccEmails:
          description: Only for email channel
          type: array
          items:
            type: string
            example: cc@gmail.com
        bccEmails:
          description: BCC email addresses. Only for email channel
          type: array
          items:
            type: string
            example: bcc@gmail.com
        channelId:
          description: >-
            ID of chat (if channel is chat) or message ID from IMAP mail server
            (if channel is email)
          type: string
          nullable: true
          example: msg-123-abc
        content:
          type: object
          description: Content of the message
          properties:
            message:
              type: string
              description: Message content
              example: Thank you for your message, we can inform you that...
          example:
            message: Thank you for your message, we can inform you that...
        intentIds:
          type: array
          description: IDs of intents that were detected in the message
          items:
            type: string
            example: ai_agent_meter_reading
        cortexRequestId:
          type: integer
          description: ID of the request to cortex
          nullable: true
          example: 123
        externalConversationId:
          type: string
          description: ID of conversation in external system
          nullable: true
          example: abc-123
        isRead:
          type: boolean
          description: Whether the conversation has been read
          example: false
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/Attachment'
        interface:
          type: object
          description: Interface object for conversation data import/export
          example: []
        createdAt:
          type: string
          format: DateTime
          example: 1657056276
        modifiedAt:
          type: string
          format: DateTime
          example: 1672756198
    Error:
      type: object
      description: Data format of Enneo error messages
      properties:
        error:
          type: string
          example: Contract 121 could not be processed
          description: Readable error message that should be shown to the user
        details:
          type: string
          example: >-
            Uncatched null point exception in testFunction() in
            /app/src/file:212
          description: Not easily readable error message that is for the developer
        txId:
          type: string
          example: c916167c94
          description: >-
            Internal transaction id. Useful for debugging. Corresponds to the
            OpenTelemetry trace ID.
    Attachment:
      type: object
      properties:
        id:
          type: integer
          description: id of attachment
          example: 103013960646
        url:
          type: string
          format: uri
          example: >-
            https://client.enneo.ai/attachments/reading_w23po_107647890574i49994_(1).pdf
        name:
          type: string
          example: reading_w23po_107647890574i49994_(1).pdf
        size:
          type: integer
          description: size of attachment in bytes.
          example: 721592
        width:
          type: integer
          description: >-
            width of image attachment in pixels. Can be ommitted for non-image
            attachments.
          example: 3120
        height:
          type: integer
          description: >-
            height of image attachment in pixels. Can be ommitted for non-image
            attachments.
          example: 4160
        inline:
          type: boolean
          description: true if attachment is an inline image
          example: false
        fileEnding:
          type: string
          description: file ending of attachment
          example: pdf
        contentType:
          type: string
          description: content type of attachment
          example: application/pdf
        originalUrl:
          type: string
          format: uri
          description: >-
            url of original attachment, most likely contains invalid temporary
            access token
          example: >-
            https://storage.example.com/attachments/reading_w23po_107647890574i49994_(1).pdf
        extractedData:
          type: object
          description: >-
            data extracted from the attachment, e.g. a PDF text or a meter
            reading
        extractionStatus:
          type: string
          description: >-
            Status of the current extraction. Valid options: "notStarted",
            "inProgress", "success", "error"
          example: notStarted
        extractionData:
          type: object
          description: Data extracted from the attachment by meterReadingMicroservice
          example:
            confidence: 1
            meterValue: 1234
      example:
        id: 103013960646,
        url: >-
          https://storage.googleapis.com/enneo-attachments-public/a1/103013960646-4b1aa775/IMG_20230301_192712.jpg
        name: IMG_20230301_192712.jpg
        size: 2292952
        width: 3120
        height: 4160
        inline: false
        fileEnding: jpg
        contentType: image/jpeg
        originalUrl: https://storage.example.com/attachments/IMG_20230301_192712.jpg
        extractedData: null
        extractionStatus: success
        extractionData:
          confidence: 0.815
          meterValue: 87870.5
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT-based authentication
      x-scopes:
        api: Full access to the API
    cookieAuth:
      type: apiKey
      in: cookie
      name: connect.sid
      description: Cookie-based authentication
      x-scopes:
        api: Full access to the API

````