{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-sns/json-schema/amazon-sns-publish-input-schema.json",
  "title": "PublishInput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-sns-publishing-api-openapi.yml#/components/schemas/PublishInput",
  "type": "object",
  "properties": {
    "TopicArn": {
      "type": "string",
      "description": "The topic you want to publish to. If you don't specify a value for the TopicArn parameter, you must specify a value for the PhoneNumber or TargetArn parameters."
    },
    "TargetArn": {
      "type": "string",
      "description": "If you don't specify a value for the TargetArn parameter, you must specify a value for the PhoneNumber or TopicArn parameters."
    },
    "PhoneNumber": {
      "type": "string",
      "description": "The phone number to which you want to deliver an SMS message. Use E.164 format. If you don't specify a value for the PhoneNumber parameter, you must specify a value for the TargetArn or TopicArn parameters."
    },
    "Message": {
      "type": "string",
      "description": "The message you want to send. If you are publishing to a topic and you want to send the same message to all transport protocols, include the text of the message as a String value. If you want to send different messages for each transport protocol, set the value of the MessageStructure parameter to json and use a JSON object for the Message parameter. Constraints: With the exception of SMS, messages must be UTF-8 encoded strings. By default, a message can be at most 256 KiB in size (262,144 bytes, not 262,144 characters). When you publish to a topic, the maximum size is determined by the topic'"
    },
    "Subject": {
      "type": "string",
      "description": "Optional parameter to be used as the \"Subject\" line when the message is delivered to email endpoints. This field will also be included, if present, in the standard JSON messages delivered to other endpoints. Constraints: Subjects must be UTF-8 text with no line breaks or control characters, and less than 100 characters long."
    },
    "MessageStructure": {
      "type": "string",
      "description": "Set MessageStructure to json if you want to send a different message for each protocol. For example, using one publish action, you can send a short message to your SMS subscribers and a longer message to your email subscribers. If you set MessageStructure to json, the value of the Message parameter must: be a syntactically valid JSON object; and contain at least a top-level JSON key of \"default\" with a value that is a string. You can define other top-level keys that define the message you want to send to a specific transport protocol (e.g., \"http\"). Valid value: json"
    },
    "MessageAttributes": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/$defs/MessageAttributeValue"
      },
      "description": "Message attributes for Publish action."
    },
    "MessageDeduplicationId": {
      "type": "string",
      "description": "This parameter applies only to FIFO (first-in-first-out) topics. The MessageDeduplicationId can contain up to 128 alphanumeric characters (a-z, A-Z, 0-9) and punctuation (!\"#$%&'()*+,-./:;?@[\\]^_`{|}~). Every message must have a unique MessageDeduplicationId, which is a token used for deduplication of sent messages within the 5 minute minimum deduplication interval. The scope of deduplication depends on the FifoThroughputScope attribute, when set to Topic the message deduplication scope is across the entire topic, when set to MessageGroup the message deduplication scope is within each individu"
    },
    "MessageGroupId": {
      "type": "string",
      "description": "The MessageGroupId can contain up to 128 alphanumeric characters (a-z, A-Z, 0-9) and punctuation (!\"#$%&'()*+,-./:;?@[\\]^_`{|}~). For FIFO topics: The MessageGroupId is a tag that specifies that a message belongs to a specific message group. Messages that belong to the same message group are processed in a FIFO manner (however, messages in different message groups might be processed out of order). Every message must include a MessageGroupId. For standard topics: The MessageGroupId is optional and is forwarded only to Amazon SQS standard subscriptions to activate fair queues. The MessageGroupId"
    }
  },
  "required": [
    "Message"
  ],
  "$defs": {
    "MessageAttributeValue": {
      "type": "object",
      "properties": {
        "DataType": {
          "type": "string",
          "description": "Amazon SNS supports the following logical data types: String, String.Array, Number, and Binary. For more information, see Message Attribute Data Types."
        },
        "StringValue": {
          "type": "string",
          "description": "Strings are Unicode with UTF8 binary encoding. For a list of code values, see ASCII Printable Characters."
        },
        "BinaryValue": {
          "type": "string",
          "format": "byte",
          "description": "Binary type attributes can store any binary data, for example, compressed data, encrypted data, or images."
        }
      },
      "required": [
        "DataType"
      ]
    }
  }
}