{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/brevo/main/json-schema/brevo-conversations-message-schema.json",
  "title": "ConversationsMessage",
  "description": "a Conversations message",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/brevo-conversations-api-openapi.yml#/components/schemas/ConversationsMessage",
  "type": "object",
  "properties": {
    "agentId": {
      "type": "string",
      "description": "ID of the agent on whose behalf the message was sent (only in messages sent by an agent)."
    },
    "agentName": {
      "type": "string",
      "description": "Agent’s name as displayed to the visitor. Only in the messages sent by an agent."
    },
    "agentUserpic": {
      "type": "string",
      "description": "Only set if the agent has uploaded a profile picture."
    },
    "attachments": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ConversationsMessageAttachmentsItems"
      },
      "description": "An array of file attachments."
    },
    "bcc": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ConversationsMessageBccItems"
      },
      "description": "An array containing details of the blind carbon copy (BCC) recipients (applicable only to messages in email threads)."
    },
    "cc": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ConversationsMessageCcItems"
      },
      "description": "An array containing details of the carbon copy (CC) recipients (applicable only to messages in email threads)."
    },
    "createdAt": {
      "type": "integer",
      "format": "int64",
      "description": "Timestamp in milliseconds."
    },
    "file": {
      "$ref": "#/$defs/ConversationsMessageFile"
    },
    "forwardedToSourceStatus": {
      "$ref": "#/$defs/ConversationsMessageForwardedToSourceStatus",
      "description": "Status of the message forwarding to the source."
    },
    "from": {
      "$ref": "#/$defs/ConversationsMessageFrom",
      "description": "An object containing details about the email sender (applicable only to messages in email threads)."
    },
    "html": {
      "type": "string",
      "description": "The HTML content of the message."
    },
    "id": {
      "type": "string",
      "description": "Message ID. It can be used for further manipulations with the message."
    },
    "integrations": {
      "$ref": "#/$defs/ConversationsMessageIntegrations",
      "description": "Integration details."
    },
    "isBot": {
      "type": "boolean",
      "description": "`true` for automated messages generated by an AI bot."
    },
    "isMissed": {
      "type": "boolean",
      "description": "`true` for missed and offline messages."
    },
    "isMissedByVisitor": {
      "type": "boolean",
      "description": "`true` for unread agent’s messages in finished chats."
    },
    "isPushed": {
      "type": "boolean",
      "description": "`true` for pushed messages"
    },
    "isTrigger": {
      "type": "boolean",
      "description": "`true` for automatic messages from “Targeted chats & triggers” and API (https://developers.brevo.com/docs/javascript-api-reference#sendautomessage)"
    },
    "rawUnsafeHtml": {
      "type": "string",
      "description": "Unescaped HTML content of the message (may include unsafe HTML)."
    },
    "receivedFrom": {
      "type": "string",
      "description": "In two-way integrations, messages sent via REST API can be marked with receivedFrom property and then filtered out when received in a webhook to avoid infinite loop."
    },
    "replyTo": {
      "$ref": "#/$defs/ConversationsMessageReplyTo",
      "description": "An object containing details of the reply-to email address (applicable only to messages in email threads)."
    },
    "sourceMessageId": {
      "type": "string",
      "description": "The ID of the message assigned by the integration source."
    },
    "subject": {
      "type": "string",
      "description": "The subject line of the email message (only for messages sent to email threads)."
    },
    "text": {
      "type": "string",
      "description": "Message text or name of the attached file"
    },
    "to": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ConversationsMessageToItems"
      },
      "description": "An array containing details of the recipients (applicable only to messages in email threads)."
    },
    "type": {
      "$ref": "#/$defs/ConversationsMessageType",
      "description": "`\"agent\"` for agents’ messages, `\"visitor\"` for visitors’ messages."
    },
    "isSentViaJsApi": {
      "type": "boolean",
      "description": "‘`true` if the message was sent via JavaScript API.’"
    },
    "messageType": {
      "type": "string",
      "description": "The type of message content (e.g. for integration-specific message types)."
    },
    "isForward": {
      "type": "boolean",
      "description": "‘`true` if the message is a forwarded message.’"
    },
    "source": {
      "$ref": "#/$defs/ConversationsMessageSource",
      "description": "Source information for the message."
    },
    "visitorId": {
      "type": "string",
      "description": "visitor’s ID"
    }
  },
  "$defs": {
    "ConversationsMessageAttachmentsItems": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the file."
        },
        "link": {
          "type": "string",
          "description": "The URL of the file."
        },
        "mimeType": {
          "type": "string",
          "description": "The MIME type of the file."
        },
        "isImage": {
          "type": "boolean",
          "description": "`true` for images."
        },
        "isSticker": {
          "type": "boolean",
          "description": "`true` for sticker files."
        },
        "isInline": {
          "type": "boolean",
          "description": "`true` for inline files."
        },
        "inlineId": {
          "type": "string",
          "description": "The ID of the inline file."
        },
        "size": {
          "type": "integer",
          "format": "int64",
          "description": "The size of the file in bytes."
        },
        "imageInfo": {
          "$ref": "#/$defs/ConversationsMessageAttachmentsItemsImageInfo",
          "description": "Image information (only present for image files)."
        },
        "isAllowedFileType": {
          "type": "boolean",
          "description": "Whether the file extension is allowed for download."
        }
      },
      "title": "ConversationsMessageAttachmentsItems"
    },
    "ConversationsMessageAttachmentsItemsImageInfo": {
      "type": "object",
      "properties": {
        "width": {
          "type": "integer",
          "format": "int64",
          "description": "Width of the image in pixels."
        },
        "height": {
          "type": "integer",
          "format": "int64",
          "description": "Height of the image in pixels."
        },
        "previewLink": {
          "type": "string",
          "description": "URL of the image preview."
        }
      },
      "description": "Image information (only present for image files).",
      "title": "ConversationsMessageAttachmentsItemsImageInfo"
    },
    "ConversationsMessageBccItems": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "title": "ConversationsMessageBccItems"
    },
    "ConversationsMessageCcItems": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "title": "ConversationsMessageCcItems"
    },
    "ConversationsMessageFile": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the file."
        },
        "link": {
          "type": "string",
          "description": "URL of the file."
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the file."
        },
        "isImage": {
          "type": "boolean",
          "description": "Whether the file is an image."
        },
        "isSticker": {
          "type": "boolean",
          "description": "Whether the file is a sticker."
        },
        "isInline": {
          "type": "boolean",
          "description": "Whether the file is inline."
        },
        "inlineId": {
          "type": "string",
          "description": "The ID of the inline file."
        },
        "size": {
          "type": "integer",
          "format": "int64",
          "description": "Size in bytes."
        },
        "imageInfo": {
          "$ref": "#/$defs/ConversationsMessageFileImageInfo",
          "description": "Image info, present when the file is an image."
        },
        "isAllowedFileType": {
          "type": "boolean",
          "description": "Whether the file extension is allowed for download."
        }
      },
      "title": "ConversationsMessageFile"
    },
    "ConversationsMessageFileImageInfo": {
      "type": "object",
      "properties": {
        "width": {
          "type": "integer",
          "format": "int64",
          "description": "Width of the image in pixels."
        },
        "height": {
          "type": "integer",
          "format": "int64",
          "description": "Height of the image in pixels."
        },
        "previewLink": {
          "type": "string",
          "description": "URL of the image preview."
        }
      },
      "description": "Image info, present when the file is an image.",
      "title": "ConversationsMessageFileImageInfo"
    },
    "ConversationsMessageForwardedToSourceStatus": {
      "type": "object",
      "properties": {
        "error": {
          "type": "string"
        },
        "isSuccess": {
          "type": "boolean"
        }
      },
      "description": "Status of the message forwarding to the source.",
      "title": "ConversationsMessageForwardedToSourceStatus"
    },
    "ConversationsMessageFrom": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "description": "An object containing details about the email sender (applicable only to messages in email threads).",
      "title": "ConversationsMessageFrom"
    },
    "ConversationsMessageIntegrations": {
      "type": "object",
      "properties": {},
      "description": "Integration details.",
      "title": "ConversationsMessageIntegrations"
    },
    "ConversationsMessageReplyTo": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "description": "An object containing details of the reply-to email address (applicable only to messages in email threads).",
      "title": "ConversationsMessageReplyTo"
    },
    "ConversationsMessageSource": {
      "type": "object",
      "properties": {},
      "description": "Source information for the message.",
      "title": "ConversationsMessageSource"
    },
    "ConversationsMessageToItems": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "title": "ConversationsMessageToItems"
    },
    "ConversationsMessageType": {
      "type": "string",
      "enum": [
        "agent",
        "visitor"
      ],
      "description": "`\"agent\"` for agents’ messages, `\"visitor\"` for visitors’ messages.",
      "title": "ConversationsMessageType"
    }
  }
}