{
  "$id": "https://intentschema.org/profiles/com.twilio/communication.sms.message.send.v1.json",
  "id": "org.intentschema.communication.sms.message.send.v1@com.twilio.v1",
  "pins": "https://intentschema.org/intents/communication/sms/message/send/v1.json",
  "title": "Twilio SMS message send profile",
  "description": "Profile for sending SMS via the Twilio Messages API. Pins target.system to `twilio`, requires E.164 numbers, and exposes Twilio-specific delivery options.",
  "constraints": {
    "properties": {
      "target": {
        "properties": {
          "system": {
            "const": "twilio"
          }
        },
        "required": [
          "system"
        ]
      },
      "object": {
        "properties": {
          "to": {
            "type": "string",
            "pattern": "^\\+[1-9][0-9]{6,14}$"
          },
          "from": {
            "type": "string"
          }
        }
      },
      "twilio": {
        "type": "object",
        "properties": {
          "messaging_service_sid": {
            "type": "string",
            "description": "Twilio Messaging Service SID (alternative to `from`)."
          },
          "status_callback": {
            "type": "string",
            "format": "uri"
          },
          "media_url": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "description": "MMS media URLs."
          },
          "smart_encoded": {
            "type": "boolean"
          }
        }
      }
    }
  },
  "api": {
    "method": "POST",
    "path": "/2010-04-01/Accounts/{AccountSid}/Messages.json",
    "scopes": [],
    "docs": "https://www.twilio.com/docs/sms/api/message-resource#create-a-message-resource",
    "params": {
      "object.to": "To (E.164 phone number)",
      "object.from": "From (E.164 number or Messaging Service SID)",
      "object.text": "Body",
      "twilio.messaging_service_sid": "MessagingServiceSid (alternative to From)",
      "twilio.status_callback": "StatusCallback (webhook URL for delivery updates)",
      "twilio.media_url": "MediaUrl (MMS media attachment URLs)",
      "twilio.smart_encoded": "SmartEncoded"
    },
    "base_url": "https://api.twilio.com"
  }
}
