{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "type": "object",
  "title": "TopicsMessagesWithAttachments",
  "description": "Topics Messages with attachments",
  "additionalProperties": false,
  "required": [
    "subject"
  ],
  "properties": {
    "subject": {
      "title": "Subject of the message",
      "type": "string"
    },
    "bodyText": {
      "title": "Body of the message in plain text",
      "type": "string"
    },
    "bodyTextId": {
      "title": "Body of the message in plain text that will be resolved by the server using the provided id. The id should be a reference to an archived text message body.",
      "type": "string"
    },
    "bodyHtml": {
      "title": "Body of the message in HTML format",
      "type": "string"
    },
    "bodyHtmlId": {
      "title": "Body of the message in html that will be resolved by the server using the provided id. The id should be a reference to an archived html message body.",
      "type": "string"
    },
    "attachments": {
      "type": "array",
      "description": "TopicMessageAttachment",
      "items": {
        "$ref": "#/definitions/TopicMessageAttachment"
      }
    },
    "messageId": {
      "title": "Message Id. Can be used to correlate the message with an external system. The messages endpoint can  be used to retrieve the messages metadata",
      "type": "string"
    }
  },
  "definitions": {
    "TopicMessageAttachment": {
      "type": "object",
      "properties": {
        "attachmentId": {
          "title": "Attachment Id. If the attachment content is not provided, the server will try to resolve the attachment content using this id as a reference to an archived attachment.",
          "type": "string"
        },
        "base64Content": {
          "title": "Base64 encoded content of the attachment. If provided, the attachmentId is not used to resolve the content.",
          "type": "string"
        },
        "filename": {
          "title": "Filename of the attachment. Only provide if the attachment content is provided in the request.",
          "type": "string"
        },
        "contentType": {
          "title": "Content type of the attachment. Only provide if the attachment content is provided in the request.",
          "type": "string"
        },
        "inline": {
          "title": "Whether the attachment is an inline attachment or not. Only provide if the attachment content is provided in the request and is referenced from the body HTML content.",
          "type": "boolean"
        }
      },
      "required": [
        "attachmentId"
      ],
      "additionalProperties": false
    }
  }
}
