{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-systems-manager/json-schema/amazon-systems-manager-list-commands-request-schema.json",
  "title": "ListCommandsRequest",
  "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/ListCommandsRequest",
  "type": "object",
  "properties": {
    "CommandId": {
      "type": "string",
      "description": "(Optional) If provided, lists only the specified command."
    },
    "InstanceId": {
      "type": "string",
      "description": "(Optional) Lists commands issued against this managed node ID. You can't specify a managed node ID in the same command that you specify Status = Pending. This is because the command hasn't reached the managed node yet."
    },
    "MaxResults": {
      "type": "integer",
      "description": "(Optional) The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results."
    },
    "NextToken": {
      "type": "string",
      "description": "(Optional) The token for the next set of items to return. (You received this token from a previous call.)"
    },
    "Filters": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CommandFilter"
      },
      "description": "(Optional) One or more filters. Use a filter to return a more specific list of results."
    }
  },
  "$defs": {
    "CommandFilter": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "enum": [
            "InvokedAfter",
            "InvokedBefore",
            "Status",
            "ExecutionStage",
            "DocumentName"
          ],
          "description": "The name of the filter. The ExecutionStage filter can't be used with the ListCommandInvocations operation, only with ListCommands."
        },
        "value": {
          "type": "string",
          "description": "The filter value. Valid values for each filter key are as follows: InvokedAfter: Specify a timestamp to limit your results. For example, specify 2024-07-07T00:00:00Z to see a list of command executions occurring July 7, 2021, and later. InvokedBefore: Specify a timestamp to limit your results. For example, specify 2024-07-07T00:00:00Z to see a list of command executions from before July 7, 2021. Status: Specify a valid command status to see a list of all command executions with that status. The status choices depend on the API you call. The status values you can specify for ListCommands are: P"
        }
      },
      "required": [
        "key",
        "value"
      ]
    }
  }
}