{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postplanify-com/json-schema/postplanify-com-message-schema.json",
  "title": "Message",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/postplanify-com-api-openapi.json#/components/schemas/Message",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "conversationId": {
      "type": "string",
      "format": "uuid"
    },
    "fromBusiness": {
      "type": "boolean",
      "description": "True for messages your business sent, false for messages from the customer."
    },
    "type": {
      "type": "string",
      "enum": [
        "TEXT",
        "IMAGE",
        "VIDEO",
        "AUDIO",
        "FILE",
        "STICKER",
        "STORY_REPLY",
        "STORY_MENTION",
        "UNKNOWN"
      ]
    },
    "text": {
      "type": [
        "string",
        "null"
      ]
    },
    "attachments": {
      "type": "array",
      "description": "Photos, videos, audio and files sent with the message. Empty for text messages.",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "mimeType": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "replyToStoryUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "For `STORY_REPLY` messages, the story the customer replied to."
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    }
  }
}