{
  "$id": "https://intentschema.org/intents/communication/sms/message/read/v1.json",
  "fqdn": "org.intentschema.communication.sms.message.read.v1",
  "title": "Read SMS message",
  "description": "Read a single SMS message by id, including body and delivery status.",
  "payload": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "required": [
      "target"
    ],
    "properties": {
      "target": {
        "allOf": [
          {
            "$ref": "https://intentschema.org/common/target/v1.json"
          },
          {
            "required": [
              "external_id"
            ]
          }
        ]
      }
    }
  },
  "result": {
    "type": "object",
    "required": [
      "external_id"
    ],
    "properties": {
      "external_id": {
        "type": "string"
      },
      "from": {
        "type": "string"
      },
      "to": {
        "type": "string"
      },
      "text": {
        "type": "string"
      },
      "direction": {
        "enum": [
          "inbound",
          "outbound"
        ]
      },
      "sent_at": {
        "type": "string",
        "format": "date-time"
      },
      "status": {
        "type": "string",
        "description": "Delivery status (queued, sent, delivered, failed, etc.)."
      },
      "num_segments": {
        "type": "integer"
      }
    }
  },
  "examples": [
    {
      "name": "read by id",
      "value": {
        "target": {
          "system": "twilio",
          "external_id": "SM1234567890abcdef"
        }
      }
    }
  ]
}
