{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postlake-dev/json-schema/postlake-dev-message-schema.json",
  "title": "Message",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postlake-dev-messages-api-openapi.yml#/components/schemas/Message",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "text": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "from": {
      "$ref": "#/$defs/SocialActor"
    },
    "fromMe": {
      "type": "boolean",
      "description": "True when you sent it, so callers never compare handles"
    },
    "content": {
      "$ref": "#/$defs/MessageContent"
    }
  },
  "$defs": {
    "MessageContent": {
      "type": "object",
      "description": "A meaningful non-text direct-message payload. This is present for attachments, shared media, and message types the network does not expose in readable form. Do not treat an empty text field with this object as an empty message.",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "attachment",
            "shared_media",
            "unsupported"
          ]
        },
        "label": {
          "type": "string"
        },
        "url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "description": "Provider URL when available. Null means the provider withheld a destination."
        }
      },
      "required": [
        "kind",
        "label",
        "url"
      ]
    },
    "SocialActor": {
      "type": "object",
      "properties": {
        "handle": {
          "type": "string"
        },
        "displayName": {
          "type": [
            "string",
            "null"
          ]
        },
        "avatarUrl": {
          "type": [
            "string",
            "null"
          ]
        },
        "id": {
          "type": [
            "string",
            "null"
          ],
          "description": "The network's own id, for follow/block/mute"
        }
      }
    }
  }
}