{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-systems-manager/json-schema/amazon-systems-manager-send-command-request-schema.json",
  "title": "SendCommandRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-systems-manager-run-command-api-openapi.yml#/components/schemas/SendCommandRequest",
  "type": "object",
  "properties": {
    "InstanceIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The IDs of the managed nodes where the command should run. Specifying managed node IDs is most useful when you are targeting a limited number of managed nodes, though you can specify up to 50 IDs. To target a larger number of managed nodes, or if you prefer not to list individual node IDs, we recommend using the Targets option instead. Using Targets, which accepts tag key-value pairs to identify the managed nodes to send commands to, you can a send command to tens, hundreds, or thousands of nodes at once. For more information about how to use targets, see Run commands at scale in the Amazon We"
    },
    "Targets": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Target"
      },
      "description": "An array of search criteria that targets managed nodes using a Key,Value combination that you specify. Specifying targets is most useful when you want to send a command to a large number of managed nodes at once. Using Targets, which accepts tag key-value pairs to identify managed nodes, you can send a command to tens, hundreds, or thousands of nodes at once. To send a command to a smaller number of managed nodes, you can use the InstanceIds option instead. For more information about how to use targets, see Run commands at scale in the Amazon Web Services Systems Manager User Guide."
    },
    "DocumentName": {
      "type": "string",
      "description": "The name of the Amazon Web Services Systems Manager document (SSM document) to run. This can be a public document or a custom document. To run a shared document belonging to another account, specify the document Amazon Resource Name (ARN). For more information about how to use shared documents, see Sharing SSM documents in the Amazon Web Services Systems Manager User Guide. If you specify a document name or ARN that hasn't been shared with your account, you receive an InvalidDocument error."
    },
    "DocumentVersion": {
      "type": "string",
      "description": "The SSM document version to use in the request. You can specify $DEFAULT, $LATEST, or a specific version number. If you run commands by using the Command Line Interface (Amazon Web Services CLI), then you must escape the first two options by using a backslash. If you specify a version number, then you don't need to use the backslash. For example: --document-version \"\\$DEFAULT\" --document-version \"\\$LATEST\" --document-version \"3\""
    },
    "DocumentHash": {
      "type": "string",
      "description": "The Sha256 or Sha1 hash created by the system when the document was created. Sha1 hashes have been deprecated."
    },
    "DocumentHashType": {
      "type": "string",
      "enum": [
        "Sha256",
        "Sha1"
      ],
      "description": "Sha256 or Sha1. Sha1 hashes have been deprecated."
    },
    "TimeoutSeconds": {
      "type": "integer",
      "description": "If this time is reached and the command hasn't already started running, it won't run."
    },
    "Comment": {
      "type": "string",
      "description": "User-specified information about the command, such as a brief description of what the command should do."
    },
    "Parameters": {
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "description": "The required and optional parameters specified in the document being run."
    },
    "OutputS3Region": {
      "type": "string",
      "description": "(Deprecated) You can no longer specify this parameter. The system ignores it. Instead, Systems Manager automatically determines the Amazon Web Services Region of the S3 bucket."
    },
    "OutputS3BucketName": {
      "type": "string",
      "description": "The name of the S3 bucket where command execution responses should be stored."
    },
    "OutputS3KeyPrefix": {
      "type": "string",
      "description": "The directory structure within the S3 bucket where the responses should be stored."
    },
    "MaxConcurrency": {
      "type": "string",
      "description": "(Optional) The maximum number of managed nodes that are allowed to run the command at the same time. You can specify a number such as 10 or a percentage such as 10%. The default value is 50. For more information about how to use MaxConcurrency, see Using concurrency controls in the Amazon Web Services Systems Manager User Guide."
    },
    "MaxErrors": {
      "type": "string",
      "description": "The maximum number of errors allowed without the command failing. When the command fails one more time beyond the value of MaxErrors, the systems stops sending the command to additional targets. You can specify a number like 10 or a percentage like 10%. The default value is 0. For more information about how to use MaxErrors, see Using error controls in the Amazon Web Services Systems Manager User Guide."
    },
    "ServiceRoleArn": {
      "type": "string",
      "description": "The ARN of the Identity and Access Management (IAM) service role to use to publish Amazon Simple Notification Service (Amazon SNS) notifications for Run Command commands. This role must provide the sns:Publish permission for your notification topic. For information about creating and using this service role, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide."
    },
    "NotificationConfig": {
      "$ref": "#/$defs/NotificationConfig"
    },
    "CloudWatchOutputConfig": {
      "$ref": "#/$defs/CloudWatchOutputConfig"
    },
    "AlarmConfiguration": {
      "$ref": "#/$defs/AlarmConfiguration"
    }
  },
  "required": [
    "DocumentName"
  ],
  "$defs": {
    "Alarm": {
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The name of your CloudWatch alarm."
        }
      },
      "required": [
        "Name"
      ]
    },
    "AlarmConfiguration": {
      "type": "object",
      "properties": {
        "IgnorePollAlarmFailure": {
          "type": "boolean",
          "description": "When this value is true, your automation or command continues to run in cases where we can’t retrieve alarm status information from CloudWatch. In cases where we successfully retrieve an alarm status of OK or INSUFFICIENT_DATA, the automation or command continues to run, regardless of this value. Default is false."
        },
        "Alarms": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Alarm"
          },
          "description": "The name of the CloudWatch alarm specified in the configuration."
        }
      },
      "required": [
        "Alarms"
      ]
    },
    "CloudWatchOutputConfig": {
      "type": "object",
      "properties": {
        "CloudWatchLogGroupName": {
          "type": "string",
          "description": "The name of the CloudWatch Logs log group where you want to send command output. If you don't specify a group name, Amazon Web Services Systems Manager automatically creates a log group for you. The log group uses the following naming format: aws/ssm/SystemsManagerDocumentName"
        },
        "CloudWatchOutputEnabled": {
          "type": "boolean",
          "description": "Enables Systems Manager to send command output to CloudWatch Logs."
        }
      }
    },
    "NotificationConfig": {
      "type": "object",
      "properties": {
        "NotificationArn": {
          "type": "string",
          "description": "An Amazon Resource Name (ARN) for an Amazon Simple Notification Service (Amazon SNS) topic. Run Command pushes notifications about command status changes to this topic."
        },
        "NotificationEvents": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "All",
              "InProgress",
              "Success",
              "TimedOut",
              "Cancelled",
              "Failed"
            ]
          },
          "description": "The different events for which you can receive notifications. To learn more about these events, see Monitoring Systems Manager status changes using Amazon SNS notifications in the Amazon Web Services Systems Manager User Guide."
        },
        "NotificationType": {
          "type": "string",
          "enum": [
            "Command",
            "Invocation"
          ],
          "description": "The type of notification. Command: Receive notification when the status of a command changes. Invocation: For commands sent to multiple managed nodes, receive notification on a per-node basis when the status of a command changes."
        }
      }
    },
    "Target": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "User-defined criteria for sending commands that target managed nodes that meet the criteria."
        },
        "Values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "User-defined criteria that maps to Key. For example, if you specified tag:ServerRole, you could specify value:WebServer to run a command on instances that include EC2 tags of ServerRole,WebServer. Depending on the type of target, the maximum number of values for a key might be lower than the global maximum of 50."
        }
      }
    }
  }
}