{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-ses/json-schema/amazon-ses-update-rule-set-request-schema.json",
  "title": "UpdateRuleSetRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-ses-rule-set-api-openapi.yml#/components/schemas/UpdateRuleSetRequest",
  "type": "object",
  "properties": {
    "RuleSetId": {
      "type": "string",
      "description": "The identifier of a rule set you want to update."
    },
    "RuleSetName": {
      "type": "string",
      "description": "A user-friendly name for the rule set resource."
    },
    "Rules": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Rule"
      },
      "description": "A new set of rules to replace the current rules of the rule set—these rules will override all the rules of the rule set."
    }
  },
  "required": [
    "RuleSetId"
  ],
  "$defs": {
    "Analysis": {
      "type": "object",
      "properties": {
        "Analyzer": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of an Add On."
        },
        "ResultField": {
          "type": "string",
          "description": "The returned value from an Add On."
        }
      },
      "required": [
        "Analyzer",
        "ResultField"
      ]
    },
    "ArchiveAction": {
      "type": "object",
      "properties": {
        "ActionFailurePolicy": {
          "type": "string",
          "enum": [
            "CONTINUE",
            "DROP"
          ],
          "description": "A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the specified archive has been deleted."
        },
        "TargetArchive": {
          "type": "string",
          "description": "The identifier of the archive to send the email to."
        }
      },
      "required": [
        "TargetArchive"
      ]
    },
    "DeliverToMailboxAction": {
      "type": "object",
      "properties": {
        "ActionFailurePolicy": {
          "type": "string",
          "enum": [
            "CONTINUE",
            "DROP"
          ],
          "description": "A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the mailbox ARN is no longer valid."
        },
        "MailboxArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of a WorkMail organization to deliver the email to."
        },
        "RoleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of an IAM role to use to execute this action. The role must have access to the workmail:DeliverToMailbox API."
        }
      },
      "required": [
        "MailboxArn",
        "RoleArn"
      ]
    },
    "DeliverToQBusinessAction": {
      "type": "object",
      "properties": {
        "ActionFailurePolicy": {
          "type": "string",
          "enum": [
            "CONTINUE",
            "DROP"
          ],
          "description": "A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the specified application has been deleted or the role lacks necessary permissions to call the qbusiness:BatchPutDocument API."
        },
        "ApplicationId": {
          "type": "string",
          "description": "The unique identifier of the Amazon Q Business application instance where the email content will be delivered."
        },
        "IndexId": {
          "type": "string",
          "description": "The identifier of the knowledge base index within the Amazon Q Business application where the email content will be stored and indexed."
        },
        "RoleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the IAM Role to use while delivering to Amazon Q Business. This role must have access to the qbusiness:BatchPutDocument API for the given application and index."
        }
      },
      "required": [
        "ApplicationId",
        "IndexId",
        "RoleArn"
      ]
    },
    "DropAction": {
      "type": "object",
      "properties": {}
    },
    "InvokeLambdaAction": {
      "type": "object",
      "properties": {
        "ActionFailurePolicy": {
          "type": "string",
          "enum": [
            "CONTINUE",
            "DROP"
          ],
          "description": "A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the Amazon Web Services Lambda function no longer exists."
        },
        "FunctionArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the Lambda function to invoke."
        },
        "InvocationType": {
          "type": "string",
          "enum": [
            "EVENT",
            "REQUEST_RESPONSE"
          ],
          "description": "The invocation type of the Lambda function. Use EVENT for asynchronous invocation or REQUEST_RESPONSE for synchronous invocation."
        },
        "RoleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the IAM role to use to invoke the Lambda function."
        },
        "RetryTimeMinutes": {
          "type": "integer",
          "description": "The maximum time in minutes that the email processing can be retried if the Lambda invocation fails. The maximum value is 2160 minutes (36 hours)."
        }
      },
      "required": [
        "FunctionArn",
        "InvocationType",
        "RoleArn"
      ]
    },
    "MailManagerAddHeaderAction": {
      "type": "object",
      "properties": {
        "HeaderName": {
          "type": "string",
          "description": "The name of the header to add to an email. The header must be prefixed with \"X-\". Headers are added regardless of whether the header name pre-existed in the email."
        },
        "HeaderValue": {
          "type": "string",
          "description": "The value of the header to add to the email."
        }
      },
      "required": [
        "HeaderName",
        "HeaderValue"
      ]
    },
    "MailManagerBounceAction": {
      "type": "object",
      "properties": {
        "ActionFailurePolicy": {
          "type": "string",
          "enum": [
            "CONTINUE",
            "DROP"
          ],
          "description": "A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the caller does not have the permissions to call the SendBounce API."
        },
        "RoleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the IAM role to use to send the bounce message."
        },
        "Sender": {
          "type": "string",
          "description": "The sender email address of the bounce message."
        },
        "StatusCode": {
          "type": "string",
          "description": "The enhanced status code for the bounce, in the format of x.y.z (e.g. 5.1.1)."
        },
        "SmtpReplyCode": {
          "type": "string",
          "description": "The SMTP reply code for the bounce, as defined by RFC 5321."
        },
        "DiagnosticMessage": {
          "type": "string",
          "description": "The diagnostic message included in the Diagnostic-Code header of the bounce."
        },
        "Message": {
          "type": "string",
          "description": "The human-readable text to include in the bounce message."
        }
      },
      "required": [
        "RoleArn",
        "Sender",
        "StatusCode",
        "SmtpReplyCode",
        "DiagnosticMessage"
      ]
    },
    "MailManagerS3Action": {
      "type": "object",
      "properties": {
        "ActionFailurePolicy": {
          "type": "string",
          "enum": [
            "CONTINUE",
            "DROP"
          ],
          "description": "A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the specified the bucket has been deleted."
        },
        "RoleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the IAM Role to use while writing to S3. This role must have access to the s3:PutObject, kms:Encrypt, and kms:GenerateDataKey APIs for the given bucket."
        },
        "S3Bucket": {
          "type": "string",
          "description": "The bucket name of the S3 bucket to write to."
        },
        "S3Prefix": {
          "type": "string",
          "description": "The S3 prefix to use for the write to the s3 bucket."
        },
        "S3SseKmsKeyId": {
          "type": "string",
          "description": "The KMS Key ID to use to encrypt the message in S3."
        }
      },
      "required": [
        "RoleArn",
        "S3Bucket"
      ]
    },
    "RelayAction": {
      "type": "object",
      "properties": {
        "ActionFailurePolicy": {
          "type": "string",
          "enum": [
            "CONTINUE",
            "DROP"
          ],
          "description": "A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the specified relay has been deleted."
        },
        "Relay": {
          "type": "string",
          "description": "The identifier of the relay resource to be used when relaying an email."
        },
        "MailFrom": {
          "type": "string",
          "enum": [
            "REPLACE",
            "PRESERVE"
          ],
          "description": "This action specifies whether to preserve or replace original mail from address while relaying received emails to a destination server."
        }
      },
      "required": [
        "Relay"
      ]
    },
    "ReplaceRecipientAction": {
      "type": "object",
      "properties": {
        "ReplaceWith": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "This action specifies the replacement recipient email addresses to insert."
        }
      }
    },
    "Rule": {
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The user-friendly name of the rule."
        },
        "Conditions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RuleCondition"
          },
          "description": "The conditions of this rule. All conditions must match the email for the actions to be executed. An empty list of conditions means that all emails match, but are still subject to any \"unless conditions\""
        },
        "Unless": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RuleCondition"
          },
          "description": "The \"unless conditions\" of this rule. None of the conditions can match the email for the actions to be executed. If any of these conditions do match the email, then the actions are not executed."
        },
        "Actions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RuleAction"
          },
          "description": "The list of actions to execute when the conditions match the incoming email, and none of the \"unless conditions\" match."
        }
      },
      "required": [
        "Actions"
      ]
    },
    "RuleAction": {
      "type": "object",
      "properties": {
        "Drop": {
          "$ref": "#/$defs/DropAction"
        },
        "Relay": {
          "$ref": "#/$defs/RelayAction"
        },
        "Archive": {
          "$ref": "#/$defs/ArchiveAction"
        },
        "WriteToS3": {
          "$ref": "#/$defs/MailManagerS3Action"
        },
        "Send": {
          "$ref": "#/$defs/SendAction"
        },
        "AddHeader": {
          "$ref": "#/$defs/MailManagerAddHeaderAction"
        },
        "ReplaceRecipient": {
          "$ref": "#/$defs/ReplaceRecipientAction"
        },
        "DeliverToMailbox": {
          "$ref": "#/$defs/DeliverToMailboxAction"
        },
        "DeliverToQBusiness": {
          "$ref": "#/$defs/DeliverToQBusinessAction"
        },
        "PublishToSns": {
          "$ref": "#/$defs/SnsAction"
        },
        "Bounce": {
          "$ref": "#/$defs/MailManagerBounceAction"
        },
        "InvokeLambda": {
          "$ref": "#/$defs/InvokeLambdaAction"
        }
      },
      "description": "Exactly one member is set."
    },
    "RuleBooleanExpression": {
      "type": "object",
      "properties": {
        "Evaluate": {
          "$ref": "#/$defs/RuleBooleanToEvaluate"
        },
        "Operator": {
          "type": "string",
          "enum": [
            "IS_TRUE",
            "IS_FALSE"
          ],
          "description": "The matching operator for a boolean condition expression."
        }
      },
      "required": [
        "Evaluate",
        "Operator"
      ]
    },
    "RuleBooleanToEvaluate": {
      "type": "object",
      "properties": {
        "Attribute": {
          "type": "string",
          "enum": [
            "READ_RECEIPT_REQUESTED",
            "TLS",
            "TLS_WRAPPED"
          ],
          "description": "The boolean type representing the allowed attribute types for an email."
        },
        "Analysis": {
          "$ref": "#/$defs/Analysis"
        },
        "IsInAddressList": {
          "$ref": "#/$defs/RuleIsInAddressList"
        }
      },
      "description": "Exactly one member is set."
    },
    "RuleCondition": {
      "type": "object",
      "properties": {
        "BooleanExpression": {
          "$ref": "#/$defs/RuleBooleanExpression"
        },
        "StringExpression": {
          "$ref": "#/$defs/RuleStringExpression"
        },
        "NumberExpression": {
          "$ref": "#/$defs/RuleNumberExpression"
        },
        "IpExpression": {
          "$ref": "#/$defs/RuleIpExpression"
        },
        "VerdictExpression": {
          "$ref": "#/$defs/RuleVerdictExpression"
        },
        "DmarcExpression": {
          "$ref": "#/$defs/RuleDmarcExpression"
        }
      },
      "description": "Exactly one member is set."
    },
    "RuleDmarcExpression": {
      "type": "object",
      "properties": {
        "Operator": {
          "type": "string",
          "enum": [
            "EQUALS",
            "NOT_EQUALS"
          ],
          "description": "The operator to apply to the DMARC policy of the incoming email."
        },
        "Values": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "NONE",
              "QUARANTINE",
              "REJECT"
            ]
          },
          "description": "The values to use for the given DMARC policy operator. For the operator EQUALS, if multiple values are given, they are evaluated as an OR. That is, if any of the given values match, the condition is deemed to match. For the operator NOT_EQUALS, if multiple values are given, they are evaluated as an AND. That is, only if the email's DMARC policy is not equal to any of the given values, then the condition is deemed to match."
        }
      },
      "required": [
        "Operator",
        "Values"
      ]
    },
    "RuleIpExpression": {
      "type": "object",
      "properties": {
        "Evaluate": {
          "$ref": "#/$defs/RuleIpToEvaluate"
        },
        "Operator": {
          "type": "string",
          "enum": [
            "CIDR_MATCHES",
            "NOT_CIDR_MATCHES"
          ],
          "description": "The operator to evaluate the IP address."
        },
        "Values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The IP CIDR blocks in format \"x.y.z.w/n\" (eg 10.0.0.0/8) to match with the email's IP address. For the operator CIDR_MATCHES, if multiple values are given, they are evaluated as an OR. That is, if the IP address is contained within any of the given CIDR ranges, the condition is deemed to match. For NOT_CIDR_MATCHES, if multiple CIDR ranges are given, the condition is deemed to match if the IP address is not contained in any of the given CIDR ranges."
        }
      },
      "required": [
        "Evaluate",
        "Operator",
        "Values"
      ]
    },
    "RuleIpToEvaluate": {
      "type": "object",
      "properties": {
        "Attribute": {
          "type": "string",
          "enum": [
            "SOURCE_IP"
          ],
          "description": "The attribute of the email to evaluate."
        }
      },
      "description": "Exactly one member is set."
    },
    "RuleIsInAddressList": {
      "type": "object",
      "properties": {
        "Attribute": {
          "type": "string",
          "enum": [
            "RECIPIENT",
            "MAIL_FROM",
            "SENDER",
            "FROM",
            "TO",
            "CC"
          ],
          "description": "The email attribute that needs to be evaluated against the address list."
        },
        "AddressLists": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The address lists that will be used for evaluation."
        }
      },
      "required": [
        "Attribute",
        "AddressLists"
      ]
    },
    "RuleNumberExpression": {
      "type": "object",
      "properties": {
        "Evaluate": {
          "$ref": "#/$defs/RuleNumberToEvaluate"
        },
        "Operator": {
          "type": "string",
          "enum": [
            "EQUALS",
            "NOT_EQUALS",
            "LESS_THAN",
            "GREATER_THAN",
            "LESS_THAN_OR_EQUAL",
            "GREATER_THAN_OR_EQUAL"
          ],
          "description": "The operator for a numeric condition expression."
        },
        "Value": {
          "type": "number",
          "description": "The value to evaluate in a numeric condition expression."
        }
      },
      "required": [
        "Evaluate",
        "Operator",
        "Value"
      ]
    },
    "RuleNumberToEvaluate": {
      "type": "object",
      "properties": {
        "Attribute": {
          "type": "string",
          "enum": [
            "MESSAGE_SIZE"
          ],
          "description": "An email attribute that is used as the number to evaluate."
        }
      },
      "description": "Exactly one member is set."
    },
    "RuleStringExpression": {
      "type": "object",
      "properties": {
        "Evaluate": {
          "$ref": "#/$defs/RuleStringToEvaluate"
        },
        "Operator": {
          "type": "string",
          "enum": [
            "EQUALS",
            "NOT_EQUALS",
            "STARTS_WITH",
            "ENDS_WITH",
            "CONTAINS"
          ],
          "description": "The matching operator for a string condition expression."
        },
        "Values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The string(s) to be evaluated in a string condition expression. For all operators, except for NOT_EQUALS, if multiple values are given, the values are processed as an OR. That is, if any of the values match the email's string using the given operator, the condition is deemed to match. However, for NOT_EQUALS, the condition is only deemed to match if none of the given strings match the email's string."
        }
      },
      "required": [
        "Evaluate",
        "Operator",
        "Values"
      ]
    },
    "RuleStringToEvaluate": {
      "type": "object",
      "properties": {
        "Attribute": {
          "type": "string",
          "enum": [
            "MAIL_FROM",
            "HELO",
            "RECIPIENT",
            "SENDER",
            "FROM",
            "SUBJECT",
            "TO",
            "CC"
          ],
          "description": "The email attribute to evaluate in a string condition expression."
        },
        "MimeHeaderAttribute": {
          "type": "string",
          "description": "The email MIME X-Header attribute to evaluate in a string condition expression."
        },
        "Analysis": {
          "$ref": "#/$defs/Analysis"
        },
        "ClientCertificateAttribute": {
          "type": "string",
          "enum": [
            "CN",
            "SAN_RFC822_NAME",
            "SAN_DNS_NAME",
            "SAN_DIRECTORY_NAME",
            "SAN_UNIFORM_RESOURCE_IDENTIFIER",
            "SAN_IP_ADDRESS",
            "SAN_REGISTERED_ID",
            "SERIAL_NUMBER"
          ],
          "description": "The client certificate attribute to evaluate in a string condition expression."
        }
      },
      "description": "Exactly one member is set."
    },
    "RuleVerdictExpression": {
      "type": "object",
      "properties": {
        "Evaluate": {
          "$ref": "#/$defs/RuleVerdictToEvaluate"
        },
        "Operator": {
          "type": "string",
          "enum": [
            "EQUALS",
            "NOT_EQUALS"
          ],
          "description": "The matching operator for a verdict condition expression."
        },
        "Values": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "PASS",
              "FAIL",
              "GRAY",
              "PROCESSING_FAILED"
            ]
          },
          "description": "The values to match with the email's verdict using the given operator. For the EQUALS operator, if multiple values are given, the condition is deemed to match if any of the given verdicts match that of the email. For the NOT_EQUALS operator, if multiple values are given, the condition is deemed to match of none of the given verdicts match the verdict of the email."
        }
      },
      "required": [
        "Evaluate",
        "Operator",
        "Values"
      ]
    },
    "RuleVerdictToEvaluate": {
      "type": "object",
      "properties": {
        "Attribute": {
          "type": "string",
          "enum": [
            "SPF",
            "DKIM"
          ],
          "description": "The email verdict attribute to evaluate in a string verdict expression."
        },
        "Analysis": {
          "$ref": "#/$defs/Analysis"
        }
      },
      "description": "Exactly one member is set."
    },
    "SendAction": {
      "type": "object",
      "properties": {
        "ActionFailurePolicy": {
          "type": "string",
          "enum": [
            "CONTINUE",
            "DROP"
          ],
          "description": "A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the caller does not have the permissions to call the sendRawEmail API."
        },
        "RoleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the role to use for this action. This role must have access to the ses:SendRawEmail API."
        }
      },
      "required": [
        "RoleArn"
      ]
    },
    "SnsAction": {
      "type": "object",
      "properties": {
        "ActionFailurePolicy": {
          "type": "string",
          "enum": [
            "CONTINUE",
            "DROP"
          ],
          "description": "A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, specified SNS topic has been deleted or the role lacks necessary permissions to call the sns:Publish API."
        },
        "TopicArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the Amazon SNS Topic to which notification for the email received will be published."
        },
        "RoleArn": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the IAM Role to use while writing to Amazon SNS. This role must have access to the sns:Publish API for the given topic."
        },
        "Encoding": {
          "type": "string",
          "enum": [
            "UTF-8",
            "BASE64"
          ],
          "description": "The encoding to use for the email within the Amazon SNS notification. The default value is UTF-8. Use BASE64 if you need to preserve all special characters, especially when the original message uses a different encoding format."
        },
        "PayloadType": {
          "type": "string",
          "enum": [
            "HEADERS",
            "CONTENT"
          ],
          "description": "The expected payload type within the Amazon SNS notification. CONTENT attempts to publish the full email content with 20KB of headers content. HEADERS extracts up to 100KB of header content to include in the notification, email content will not be included to the notification. The default value is CONTENT."
        }
      },
      "required": [
        "TopicArn",
        "RoleArn"
      ]
    }
  }
}