{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://api-evangelist.com/schemas/messagebird/message.json", "title": "MessageBird SMS Message", "description": "Represents an SMS message sent or received through the MessageBird SMS Messaging API.", "type": "object", "required": ["id", "recipients", "originator", "body"], "properties": { "id": { "type": "string", "description": "A unique random identifier for the message, generated by the MessageBird platform." }, "href": { "type": "string", "format": "uri", "description": "The URL of the message resource." }, "direction": { "type": "string", "description": "The direction of the message. mt for outbound, mo for inbound.", "enum": ["mt", "mo"] }, "type": { "type": "string", "description": "The type of message.", "enum": ["sms", "binary", "flash"], "default": "sms" }, "originator": { "type": "string", "description": "The sender of the message. Can be a phone number or alphanumeric string.", "maxLength": 17 }, "body": { "type": "string", "description": "The body of the SMS message.", "maxLength": 1377 }, "reference": { "type": "string", "description": "A client reference for tracking purposes." }, "reportUrl": { "type": "string", "format": "uri", "description": "The URL for delivery report callbacks." }, "validity": { "type": "integer", "description": "The validity period of the message in seconds.", "minimum": 1 }, "gateway": { "type": "integer", "description": "The SMS route used to send the message." }, "typeDetails": { "type": "object", "description": "Additional type-specific message details." }, "datacoding": { "type": "string", "description": "The encoding used for the message body.", "enum": ["plain", "unicode", "auto"], "default": "plain" }, "mclass": { "type": "integer", "description": "The message class.", "enum": [0, 1] }, "scheduledDatetime": { "type": "string", "format": "date-time", "description": "The scheduled date and time for the message in RFC 3339 format." }, "createdDatetime": { "type": "string", "format": "date-time", "description": "The date and time when the message was created." }, "recipients": { "$ref": "#/$defs/Recipients" } }, "$defs": { "Recipients": { "type": "object", "description": "The recipients collection for the message.", "properties": { "totalCount": { "type": "integer", "description": "The total number of recipients.", "minimum": 0 }, "totalSentCount": { "type": "integer", "description": "The number of messages sent.", "minimum": 0 }, "totalDeliveredCount": { "type": "integer", "description": "The number of messages delivered.", "minimum": 0 }, "totalDeliveryFailedCount": { "type": "integer", "description": "The number of messages that failed to deliver.", "minimum": 0 }, "items": { "type": "array", "description": "The list of recipient details.", "items": { "$ref": "#/$defs/Recipient" } } } }, "Recipient": { "type": "object", "description": "A single message recipient with delivery status.", "properties": { "recipient": { "type": "integer", "format": "int64", "description": "The recipient phone number." }, "status": { "type": "string", "description": "The delivery status of the message for this recipient.", "enum": ["scheduled", "sent", "buffered", "delivered", "expired", "delivery_failed"] }, "statusDatetime": { "type": "string", "format": "date-time", "description": "The date and time of the last status update." } } } } }