{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A direct message in a conversation.",
      "key": "tid",
      "record": {
        "properties": {
          "authorAvatar": {
            "format": "uri",
            "type": "string"
          },
          "authorDid": {
            "format": "did",
            "type": "string"
          },
          "authorHandle": {
            "type": "string"
          },
          "authorName": {
            "type": "string"
          },
          "body": {
            "maxLength": 2000,
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "conversationRef": {
            "format": "at-uri",
            "type": "string"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "read": {
            "type": "boolean"
          },
          "recipientDid": {
            "format": "did",
            "type": "string"
          }
        },
        "required": [
          "recipientDid",
          "body",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "description": "A single message in a 1:1 conversation, mirrored to AT Protocol as a real org.swappulse.directMessage record. The sender is tracked by authorDid; the recipient by recipientDid so both can read.",
  "id": "org.swappulse.directMessage",
  "lexicon": 1,
  "revision": 1
}
