{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/clickatell/main/json-schema/clickatell-omni-reply-callback-request-schema.json",
  "title": "OmniReplyCallbackRequest",
  "x-generated": "2026-10-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/clickatell-one-api-client-callbacks-openapi.json#/components/schemas/OmniReplyCallbackRequest",
  "type": "object",
  "properties": {
    "integrationId": {
      "type": "string"
    },
    "integrationName": {
      "type": "string"
    },
    "event": {
      "$ref": "#/$defs/ReplyEvents"
    }
  },
  "$defs": {
    "ButtonResponseReply": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "description": "Specifies the channel which is used with the specified message",
          "enum": [
            "sms",
            "whatsapp"
          ]
        },
        "messageId": {
          "type": "string",
          "description": "Id of a message that originated from client"
        },
        "relatedMessageId": {
          "type": "string",
          "description": "Id of a message to which client responds"
        },
        "relatedClientMessageId": {
          "type": "string",
          "description": "Id which was specified in <i>clientMessageId</i> field"
        },
        "from": {
          "type": "string",
          "description": "Sender identifier. Phone number (international format, no leading +) or WhatsApp BSUID (Business-Scoped User ID, format: CC.alphanumeric, max 131 chars) for WhatsApp messages."
        },
        "to": {
          "type": "string",
          "description": "Receiver phone number"
        },
        "timestamp": {
          "type": "integer",
          "description": "Unix timestamp when the system received the message in milliseconds",
          "format": "int64"
        },
        "encryptionKey": {
          "type": "string",
          "description": "<b>Client side encryption ONLY</b><br>Base64 encoded CipherTextBlob which must be used to generate the plain text decryption key for decryption of the content parameter"
        },
        "whatsapp": {
          "$ref": "#/$defs/WhatsAppContent"
        },
        "postbackData": {
          "type": "string"
        },
        "selectedItem": {
          "$ref": "#/$defs/SelectedButtonItem"
        }
      }
    },
    "ContactsReply": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "description": "Specifies the channel which is used with the specified message",
          "enum": [
            "sms",
            "whatsapp"
          ]
        },
        "messageId": {
          "type": "string",
          "description": "Id of a message that originated from client"
        },
        "relatedMessageId": {
          "type": "string",
          "description": "Id of a message to which client responds"
        },
        "relatedClientMessageId": {
          "type": "string",
          "description": "Id which was specified in <i>clientMessageId</i> field"
        },
        "from": {
          "type": "string",
          "description": "Sender identifier. Phone number (international format, no leading +) or WhatsApp BSUID (Business-Scoped User ID, format: CC.alphanumeric, max 131 chars) for WhatsApp messages."
        },
        "to": {
          "type": "string",
          "description": "Receiver phone number"
        },
        "timestamp": {
          "type": "integer",
          "description": "Unix timestamp when the system received the message in milliseconds",
          "format": "int64"
        },
        "encryptionKey": {
          "type": "string",
          "description": "<b>Client side encryption ONLY</b><br>Base64 encoded CipherTextBlob which must be used to generate the plain text decryption key for decryption of the content parameter"
        },
        "whatsapp": {
          "$ref": "#/$defs/WhatsAppContent"
        },
        "contacts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WhatsAppContact"
          }
        },
        "charset": {
          "type": "string"
        }
      }
    },
    "InlineMediaReply": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "description": "Specifies the channel which is used with the specified message",
          "enum": [
            "sms",
            "whatsapp"
          ]
        },
        "messageId": {
          "type": "string",
          "description": "Id of a message that originated from client"
        },
        "relatedMessageId": {
          "type": "string",
          "description": "Id of a message to which client responds"
        },
        "relatedClientMessageId": {
          "type": "string",
          "description": "Id which was specified in <i>clientMessageId</i> field"
        },
        "from": {
          "type": "string",
          "description": "Sender identifier. Phone number (international format, no leading +) or WhatsApp BSUID (Business-Scoped User ID, format: CC.alphanumeric, max 131 chars) for WhatsApp messages."
        },
        "to": {
          "type": "string",
          "description": "Receiver phone number"
        },
        "timestamp": {
          "type": "integer",
          "description": "Unix timestamp when the system received the message in milliseconds",
          "format": "int64"
        },
        "encryptionKey": {
          "type": "string",
          "description": "<b>Client side encryption ONLY</b><br>Base64 encoded CipherTextBlob which must be used to generate the plain text decryption key for decryption of the content parameter"
        },
        "whatsapp": {
          "$ref": "#/$defs/WhatsAppContent"
        },
        "caption": {
          "type": "string"
        },
        "content": {
          "type": "string"
        },
        "sha256Hash": {
          "type": "string"
        },
        "contentType": {
          "type": "string"
        }
      }
    },
    "ListPickerResponseReply": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "description": "Specifies the channel which is used with the specified message",
          "enum": [
            "sms",
            "whatsapp"
          ]
        },
        "messageId": {
          "type": "string",
          "description": "Id of a message that originated from client"
        },
        "relatedMessageId": {
          "type": "string",
          "description": "Id of a message to which client responds"
        },
        "relatedClientMessageId": {
          "type": "string",
          "description": "Id which was specified in <i>clientMessageId</i> field"
        },
        "from": {
          "type": "string",
          "description": "Sender identifier. Phone number (international format, no leading +) or WhatsApp BSUID (Business-Scoped User ID, format: CC.alphanumeric, max 131 chars) for WhatsApp messages."
        },
        "to": {
          "type": "string",
          "description": "Receiver phone number"
        },
        "timestamp": {
          "type": "integer",
          "description": "Unix timestamp when the system received the message in milliseconds",
          "format": "int64"
        },
        "encryptionKey": {
          "type": "string",
          "description": "<b>Client side encryption ONLY</b><br>Base64 encoded CipherTextBlob which must be used to generate the plain text decryption key for decryption of the content parameter"
        },
        "whatsapp": {
          "$ref": "#/$defs/WhatsAppContent"
        },
        "postbackData": {
          "type": "string"
        },
        "selectedItems": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SelectedButtonItem"
          }
        }
      }
    },
    "LocationReply": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "description": "Specifies the channel which is used with the specified message",
          "enum": [
            "sms",
            "whatsapp"
          ]
        },
        "messageId": {
          "type": "string",
          "description": "Id of a message that originated from client"
        },
        "relatedMessageId": {
          "type": "string",
          "description": "Id of a message to which client responds"
        },
        "relatedClientMessageId": {
          "type": "string",
          "description": "Id which was specified in <i>clientMessageId</i> field"
        },
        "from": {
          "type": "string",
          "description": "Sender identifier. Phone number (international format, no leading +) or WhatsApp BSUID (Business-Scoped User ID, format: CC.alphanumeric, max 131 chars) for WhatsApp messages."
        },
        "to": {
          "type": "string",
          "description": "Receiver phone number"
        },
        "timestamp": {
          "type": "integer",
          "description": "Unix timestamp when the system received the message in milliseconds",
          "format": "int64"
        },
        "encryptionKey": {
          "type": "string",
          "description": "<b>Client side encryption ONLY</b><br>Base64 encoded CipherTextBlob which must be used to generate the plain text decryption key for decryption of the content parameter"
        },
        "whatsapp": {
          "$ref": "#/$defs/WhatsAppContent"
        },
        "charset": {
          "type": "string",
          "description": "Character encoding",
          "default": "UTF-8"
        },
        "locationAddress": {
          "type": "string",
          "description": "Address of the location"
        },
        "locationName": {
          "type": "string",
          "description": "Name of the location"
        },
        "latitude": {
          "type": "string",
          "description": "Numeric latitude value expressed as a string"
        },
        "latitute": {
          "type": "string",
          "description": "Numeric latitude value expressed as a string"
        },
        "longitude": {
          "type": "string",
          "description": "Numeric longitude value expressed as a string"
        }
      }
    },
    "MediaReply": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "description": "Specifies the channel which is used with the specified message",
          "enum": [
            "sms",
            "whatsapp"
          ]
        },
        "messageId": {
          "type": "string",
          "description": "Id of a message that originated from client"
        },
        "relatedMessageId": {
          "type": "string",
          "description": "Id of a message to which client responds"
        },
        "relatedClientMessageId": {
          "type": "string",
          "description": "Id which was specified in <i>clientMessageId</i> field"
        },
        "from": {
          "type": "string",
          "description": "Sender identifier. Phone number (international format, no leading +) or WhatsApp BSUID (Business-Scoped User ID, format: CC.alphanumeric, max 131 chars) for WhatsApp messages."
        },
        "to": {
          "type": "string",
          "description": "Receiver phone number"
        },
        "timestamp": {
          "type": "integer",
          "description": "Unix timestamp when the system received the message in milliseconds",
          "format": "int64"
        },
        "encryptionKey": {
          "type": "string",
          "description": "<b>Client side encryption ONLY</b><br>Base64 encoded CipherTextBlob which must be used to generate the plain text decryption key for decryption of the content parameter"
        },
        "whatsapp": {
          "$ref": "#/$defs/WhatsAppContent"
        },
        "caption": {
          "type": "string"
        }
      },
      "anyOf": [
        {
          "$ref": "#/$defs/InlineMediaReply"
        },
        {
          "$ref": "#/$defs/ReferenceMediaReply"
        }
      ]
    },
    "ReferenceMediaFile": {
      "required": [
        "byteSize",
        "contentType",
        "downloadUrl"
      ],
      "type": "object",
      "properties": {
        "contentType": {
          "type": "string",
          "description": "Media content type for the media item"
        },
        "downloadUrl": {
          "type": "string",
          "description": "Download URL to be used for downloading the media item"
        },
        "sha256Hash": {
          "type": "string"
        },
        "byteSize": {
          "type": "integer",
          "description": "Byte size of the file to be downloaded",
          "format": "int64"
        },
        "fileName": {
          "type": "string",
          "description": "Original file name (if it is available)"
        }
      }
    },
    "ReferenceMediaReply": {
      "required": [
        "files"
      ],
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "description": "Specifies the channel which is used with the specified message",
          "enum": [
            "sms",
            "whatsapp"
          ]
        },
        "messageId": {
          "type": "string",
          "description": "Id of a message that originated from client"
        },
        "relatedMessageId": {
          "type": "string",
          "description": "Id of a message to which client responds"
        },
        "relatedClientMessageId": {
          "type": "string",
          "description": "Id which was specified in <i>clientMessageId</i> field"
        },
        "from": {
          "type": "string",
          "description": "Sender identifier. Phone number (international format, no leading +) or WhatsApp BSUID (Business-Scoped User ID, format: CC.alphanumeric, max 131 chars) for WhatsApp messages."
        },
        "to": {
          "type": "string",
          "description": "Receiver phone number"
        },
        "timestamp": {
          "type": "integer",
          "description": "Unix timestamp when the system received the message in milliseconds",
          "format": "int64"
        },
        "encryptionKey": {
          "type": "string",
          "description": "<b>Client side encryption ONLY</b><br>Base64 encoded CipherTextBlob which must be used to generate the plain text decryption key for decryption of the content parameter"
        },
        "whatsapp": {
          "$ref": "#/$defs/WhatsAppContent"
        },
        "caption": {
          "type": "string"
        },
        "files": {
          "type": "array",
          "description": "An array of the file object with a list of media items that is attached to the inbound media message. This parameter is only applicable to MO event callbacks for media by reference ",
          "items": {
            "$ref": "#/$defs/ReferenceMediaFile"
          }
        }
      }
    },
    "ReferralInfo": {
      "type": "object",
      "properties": {
        "headline": {
          "type": "string",
          "description": "Headline used in the ad that generated the message."
        },
        "content": {
          "type": "string",
          "description": "Body from the ad that generated the message."
        },
        "sourceType": {
          "type": "string",
          "description": "The type of the ad’s source.",
          "enum": [
            "ad",
            "post"
          ]
        },
        "sourceId": {
          "type": "string",
          "description": "Facebook ID for an ad or a post."
        },
        "sourceUrl": {
          "type": "string",
          "description": "The url that leads to the ad or post. Opening this url takes you to the ad viewed by your user."
        }
      }
    },
    "ReplyEvents": {
      "type": "object",
      "properties": {
        "moText": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TextReply"
          }
        },
        "moMedia": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MediaReply"
          }
        },
        "moLocation": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/LocationReply"
          }
        },
        "moContacts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContactsReply"
          }
        },
        "moSuggestedResponse": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/SuggestedResponseReply"
          }
        },
        "moListPickerResponse": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ListPickerResponseReply"
          }
        },
        "moButtonResponse": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ButtonResponseReply"
          }
        }
      }
    },
    "SelectedButtonItem": {
      "type": "object",
      "properties": {
        "postbackData": {
          "type": "string"
        },
        "content": {
          "type": "string"
        }
      }
    },
    "Sms": {
      "type": "object",
      "properties": {
        "udh": {
          "type": "string"
        },
        "network": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "SuggestedResponseReply": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "description": "Specifies the channel which is used with the specified message",
          "enum": [
            "sms",
            "whatsapp"
          ]
        },
        "messageId": {
          "type": "string",
          "description": "Id of a message that originated from client"
        },
        "relatedMessageId": {
          "type": "string",
          "description": "Id of a message to which client responds"
        },
        "relatedClientMessageId": {
          "type": "string",
          "description": "Id which was specified in <i>clientMessageId</i> field"
        },
        "from": {
          "type": "string",
          "description": "Sender identifier. Phone number (international format, no leading +) or WhatsApp BSUID (Business-Scoped User ID, format: CC.alphanumeric, max 131 chars) for WhatsApp messages."
        },
        "to": {
          "type": "string",
          "description": "Receiver phone number"
        },
        "timestamp": {
          "type": "integer",
          "description": "Unix timestamp when the system received the message in milliseconds",
          "format": "int64"
        },
        "encryptionKey": {
          "type": "string",
          "description": "<b>Client side encryption ONLY</b><br>Base64 encoded CipherTextBlob which must be used to generate the plain text decryption key for decryption of the content parameter"
        },
        "whatsapp": {
          "$ref": "#/$defs/WhatsAppContent"
        },
        "charset": {
          "type": "string"
        },
        "postbackData": {
          "type": "string"
        },
        "content": {
          "type": "string"
        }
      }
    },
    "TextReply": {
      "type": "object",
      "properties": {
        "channel": {
          "type": "string",
          "description": "Specifies the channel which is used with the specified message",
          "enum": [
            "sms",
            "whatsapp"
          ]
        },
        "messageId": {
          "type": "string",
          "description": "Id of a message that originated from client"
        },
        "relatedMessageId": {
          "type": "string",
          "description": "Id of a message to which client responds"
        },
        "relatedClientMessageId": {
          "type": "string",
          "description": "Id which was specified in <i>clientMessageId</i> field"
        },
        "from": {
          "type": "string",
          "description": "Sender identifier. Phone number (international format, no leading +) or WhatsApp BSUID (Business-Scoped User ID, format: CC.alphanumeric, max 131 chars) for WhatsApp messages."
        },
        "to": {
          "type": "string",
          "description": "Receiver phone number"
        },
        "timestamp": {
          "type": "integer",
          "description": "Unix timestamp when the system received the message in milliseconds",
          "format": "int64"
        },
        "encryptionKey": {
          "type": "string",
          "description": "<b>Client side encryption ONLY</b><br>Base64 encoded CipherTextBlob which must be used to generate the plain text decryption key for decryption of the content parameter"
        },
        "whatsapp": {
          "$ref": "#/$defs/WhatsAppContent"
        },
        "charset": {
          "type": "string"
        },
        "content": {
          "type": "string"
        },
        "sms": {
          "$ref": "#/$defs/Sms"
        }
      }
    },
    "WhatsAppContact": {
      "required": [
        "name"
      ],
      "type": "object",
      "properties": {
        "addresses": {
          "minItems": 1,
          "type": "array",
          "description": "List of address object. See request example WhatsApp Contacts: One message",
          "items": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "birthday": {
          "pattern": "YYYY-MM-DD",
          "type": "string",
          "description": "String date value."
        },
        "emails": {
          "minItems": 1,
          "type": "array",
          "description": "List of the email object. See request example WhatsApp Contacts: One message",
          "items": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "name": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "description": "Name object. See request example WhatsApp Contacts: One message"
          },
          "description": "Name object. See request example WhatsApp Contacts: One message"
        },
        "origin": {
          "type": "string",
          "description": "<b>WhatsApp inbound only</b><br>Indicates how the contact was shared by the user. <i>contact_request</i> means the contact was shared in direct response to a REQUEST_CONTACT_INFO button; <i>other</i> means the contact was shared organically (e.g. a forwarded vCard). Present only on inbound contact messages when supplied by WhatsApp; omitted when absent. Not encrypted for client-side encryption.",
          "enum": [
            "contact_request",
            "other"
          ]
        },
        "org": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "description": "See request example WhatsApp Contacts: One message"
          },
          "description": "See request example WhatsApp Contacts: One message"
        },
        "phones": {
          "minItems": 1,
          "type": "array",
          "description": "List of the phone object. See request example WhatsApp Contacts: One message",
          "items": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "urls": {
          "minItems": 1,
          "type": "array",
          "description": "List of the url object. See request example WhatsApp Contacts: One message",
          "items": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      }
    },
    "WhatsAppContent": {
      "type": "object",
      "properties": {
        "profileName": {
          "type": "string",
          "description": "Users profile name as set up on their WA Client"
        },
        "referralInfo": {
          "$ref": "#/$defs/ReferralInfo"
        },
        "userId": {
          "type": "string",
          "description": "Business-Scoped User ID (BSUID) of the WhatsApp user. Format: CC.alphanumeric (max 131 chars). Always present for WhatsApp messages. Not encrypted for client-side encryption."
        },
        "parentUserId": {
          "type": "string",
          "description": "Parent BSUID for linked business portfolios. Format: CC.ENT.alphanumeric (max 135 chars). Present only if your company is an eligible enterprise explicitly enrolled in a Parent BSUID account. Not encrypted for client-side encryption."
        },
        "username": {
          "type": "string",
          "description": "WhatsApp username handle. Present only if the user has enabled a username. Encrypted for client-side encryption."
        }
      },
      "description": "WhatsApp specific content"
    }
  }
}