{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/popp/json-schema/popp-list-conversation-messages-response-schema.json",
  "title": "ListConversationMessagesResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/popp-conversations-api-openapi.yml#/components/schemas/ListConversationMessagesResponse",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the message"
          },
          "conversationId": {
            "type": "string",
            "description": "ID of the conversation this message belongs to"
          },
          "body": {
            "type": "string",
            "description": "The content of the message"
          },
          "sender": {
            "type": "string",
            "enum": [
              "AGENT",
              "PROSPECT",
              "USER"
            ],
            "description": "The sender of the message"
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "NOT_SENT",
              "READ",
              "RECEIVED_SUCCESS",
              "SENT",
              "SENT_FAILED",
              "SENT_SKIPPED",
              "SENT_SUCCESS"
            ],
            "description": "The delivery status of the message"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the message was created"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the message was last updated"
          },
          "deliveredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the message was delivered"
          },
          "readAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the message was read"
          },
          "isInitial": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether this is the initial message in the conversation"
          },
          "isFallback": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether this is a fallback message"
          },
          "isNegativeSentiment": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the message has negative sentiment"
          },
          "sentimentName": {
            "type": [
              "string",
              "null"
            ],
            "description": "The sentiment classification of the message"
          },
          "emailSubjectLine": {
            "type": [
              "string",
              "null"
            ],
            "description": "The email subject line if this is an email message"
          },
          "isEmailOpened": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Whether the email has been opened"
          },
          "media": {
            "type": [
              "object",
              "null"
            ],
            "description": "Media attached to the message",
            "properties": {
              "fileName": {
                "type": "string",
                "description": "Name of the media file"
              },
              "contentType": {
                "type": "string",
                "description": "MIME type of the media"
              },
              "size": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Size of the media in bytes"
              },
              "classifiedDocumentType": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Classified type of the document"
              }
            }
          }
        },
        "required": [
          "id",
          "conversationId",
          "body",
          "sender",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    },
    "nextToken": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "data"
  ],
  "additionalProperties": false
}