{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://jambonz.org/schema/verbs/message",
  "minVersion": "0.9.6",
  "title": "Message",
  "description": "Sends an SMS or MMS message. Can be used during a voice call to send a text message to the caller or another party, or as a standalone action.",
  "type": "object",
  "properties": {
    "verb": {
      "const": "message"
    },
    "id": {
      "type": "string",
      "description": "An optional unique identifier for this verb instance."
    },
    "to": {
      "type": "string",
      "description": "The destination phone number in E.164 format.",
      "examples": [
        "+15085551212"
      ]
    },
    "from": {
      "type": "string",
      "description": "The sender phone number in E.164 format. Must be a number provisioned on the jambonz platform.",
      "examples": [
        "+15085559876"
      ]
    },
    "text": {
      "type": "string",
      "description": "The text content of the message."
    },
    "media": {
      "oneOf": [
        {
          "type": "string",
          "format": "uri"
        },
        {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          }
        }
      ],
      "description": "URL(s) of media to attach to the message (MMS). Can be images, audio, or video.",
      "examples": [
        "https://example.com/images/receipt.png"
      ]
    },
    "carrier": {
      "type": "string",
      "description": "The messaging carrier to use. If not specified, the default carrier is used."
    },
    "account_sid": {
      "type": "string",
      "description": "The account SID to use for sending. Defaults to the current account."
    },
    "message_sid": {
      "type": "string",
      "description": "An optional message SID for tracking."
    },
    "actionHook": {
      "$ref": "../components/actionHook",
      "description": "A webhook invoked when the message send completes or fails."
    }
  },
  "required": [
    "to",
    "from"
  ],
  "examples": [
    {
      "verb": "message",
      "to": "+15085551212",
      "from": "+15085559876",
      "text": "Your order has been confirmed. Order #12345."
    }
  ]
}
