{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-iot-core/json-schema/amazon-iot-core-create-job-request-schema.json",
  "title": "CreateJobRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-iot-core-jobs-api-openapi.yml#/components/schemas/CreateJobRequest",
  "type": "object",
  "properties": {
    "jobId": {
      "type": "string",
      "description": "A job identifier which must be unique for your account. We recommend using a UUID. Alpha-numeric characters, \"-\" and \"_\" are valid for use here."
    },
    "targets": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "A list of things and thing groups to which the job should be sent."
    },
    "documentSource": {
      "type": "string",
      "description": "An S3 link, or S3 object URL, to the job document. The link is an Amazon S3 object URL and is required if you don't specify a value for document. For example, --document-source https://s3.region-code.amazonaws.com/example-firmware/device-firmware.1.0 For more information, see Methods for accessing a bucket."
    },
    "document": {
      "type": "string",
      "description": "The job document. Required if you don't specify a value for documentSource."
    },
    "description": {
      "type": "string",
      "description": "A short text description of the job."
    },
    "presignedUrlConfig": {
      "$ref": "#/$defs/PresignedUrlConfig"
    },
    "targetSelection": {
      "type": "string",
      "enum": [
        "CONTINUOUS",
        "SNAPSHOT"
      ],
      "description": "Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT). If continuous, the job may also be run on a thing when a change is detected in a target. For example, a job will run on a thing when the thing is added to a target group, even after the job was completed by all things originally in the group. We recommend that you use continuous jobs instead of snapshot jobs for dynamic thing group targets. By using continuous jobs, devices that join the group receive the job execution even after the jo"
    },
    "jobExecutionsRolloutConfig": {
      "$ref": "#/$defs/JobExecutionsRolloutConfig"
    },
    "abortConfig": {
      "$ref": "#/$defs/AbortConfig"
    },
    "timeoutConfig": {
      "$ref": "#/$defs/TimeoutConfig"
    },
    "tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "description": "Metadata which can be used to manage the job."
    },
    "namespaceId": {
      "type": "string",
      "description": "The namespace used to indicate that a job is a customer-managed job. When you specify a value for this parameter, Amazon Web Services IoT Core sends jobs notifications to MQTT topics that contain the value in the following format. $aws/things/THING_NAME/jobs/JOB_ID/notify-namespace-NAMESPACE_ID/ The namespaceId feature is only supported by IoT Greengrass at this time. For more information, see Setting up IoT Greengrass core devices."
    },
    "jobTemplateArn": {
      "type": "string",
      "description": "The ARN of the job template used to create the job."
    },
    "jobExecutionsRetryConfig": {
      "$ref": "#/$defs/JobExecutionsRetryConfig"
    },
    "documentParameters": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Parameters of an Amazon Web Services managed template that you can specify to create the job document. documentParameters can only be used when creating jobs from Amazon Web Services managed templates. This parameter can't be used with custom job templates or to create jobs from them."
    },
    "schedulingConfig": {
      "$ref": "#/$defs/SchedulingConfig"
    },
    "destinationPackageVersions": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The package version Amazon Resource Names (ARNs) that are installed on the device when the job successfully completes. The package version must be in either the Published or Deprecated state when the job deploys. For more information, see Package version lifecycle. Note:The following Length Constraints relates to a single ARN. Up to 25 package version ARNs are allowed."
    }
  },
  "required": [
    "jobId",
    "targets"
  ],
  "$defs": {
    "AbortConfig": {
      "type": "object",
      "properties": {
        "criteriaList": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AbortCriteria"
          },
          "description": "The list of criteria that determine when and how to abort the job."
        }
      },
      "required": [
        "criteriaList"
      ]
    },
    "AbortCriteria": {
      "type": "object",
      "properties": {
        "failureType": {
          "type": "string",
          "enum": [
            "FAILED",
            "REJECTED",
            "TIMED_OUT",
            "ALL"
          ],
          "description": "The type of job execution failures that can initiate a job abort."
        },
        "action": {
          "type": "string",
          "enum": [
            "CANCEL"
          ],
          "description": "The type of job action to take to initiate the job abort."
        },
        "thresholdPercentage": {
          "type": "number",
          "description": "The minimum percentage of job execution failures that must occur to initiate the job abort. Amazon Web Services IoT Core supports up to two digits after the decimal (for example, 10.9 and 10.99, but not 10.999)."
        },
        "minNumberOfExecutedThings": {
          "type": "integer",
          "description": "The minimum number of things which must receive job execution notifications before the job can be aborted."
        }
      },
      "required": [
        "failureType",
        "action",
        "thresholdPercentage",
        "minNumberOfExecutedThings"
      ]
    },
    "ExponentialRolloutRate": {
      "type": "object",
      "properties": {
        "baseRatePerMinute": {
          "type": "integer",
          "description": "The minimum number of things that will be notified of a pending job, per minute at the start of job rollout. This parameter allows you to define the initial rate of rollout."
        },
        "incrementFactor": {
          "type": "number",
          "description": "The exponential factor to increase the rate of rollout for a job. Amazon Web Services IoT Core supports up to one digit after the decimal (for example, 1.5, but not 1.55)."
        },
        "rateIncreaseCriteria": {
          "$ref": "#/$defs/RateIncreaseCriteria"
        }
      },
      "required": [
        "baseRatePerMinute",
        "incrementFactor",
        "rateIncreaseCriteria"
      ]
    },
    "JobExecutionsRetryConfig": {
      "type": "object",
      "properties": {
        "criteriaList": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RetryCriteria"
          },
          "description": "The list of criteria that determines how many retries are allowed for each failure type for a job."
        }
      },
      "required": [
        "criteriaList"
      ]
    },
    "JobExecutionsRolloutConfig": {
      "type": "object",
      "properties": {
        "maximumPerMinute": {
          "type": "integer",
          "description": "The maximum number of things that will be notified of a pending job, per minute. This parameter allows you to create a staged rollout."
        },
        "exponentialRate": {
          "$ref": "#/$defs/ExponentialRolloutRate"
        }
      }
    },
    "MaintenanceWindow": {
      "type": "object",
      "properties": {
        "startTime": {
          "type": "string",
          "description": "Displays the start time of the next maintenance window."
        },
        "durationInMinutes": {
          "type": "integer",
          "description": "Displays the duration of the next maintenance window."
        }
      },
      "required": [
        "startTime",
        "durationInMinutes"
      ]
    },
    "PresignedUrlConfig": {
      "type": "object",
      "properties": {
        "roleArn": {
          "type": "string",
          "description": "The ARN of an IAM role that grants permission to download files from the S3 bucket where the job data/updates are stored. The role must also grant permission for IoT to download the files. For information about addressing the confused deputy problem, see cross-service confused deputy prevention in the Amazon Web Services IoT Core developer guide."
        },
        "expiresInSec": {
          "type": "integer",
          "description": "How long (in seconds) pre-signed URLs are valid. Valid values are 60 - 3600, the default value is 3600 seconds. Pre-signed URLs are generated when Jobs receives an MQTT request for the job document."
        }
      }
    },
    "RateIncreaseCriteria": {
      "type": "object",
      "properties": {
        "numberOfNotifiedThings": {
          "type": "integer",
          "description": "The threshold for number of notified things that will initiate the increase in rate of rollout."
        },
        "numberOfSucceededThings": {
          "type": "integer",
          "description": "The threshold for number of succeeded things that will initiate the increase in rate of rollout."
        }
      }
    },
    "RetryCriteria": {
      "type": "object",
      "properties": {
        "failureType": {
          "type": "string",
          "enum": [
            "FAILED",
            "TIMED_OUT",
            "ALL"
          ],
          "description": "The type of job execution failures that can initiate a job retry."
        },
        "numberOfRetries": {
          "type": "integer",
          "description": "The number of retries allowed for a failure type for the job."
        }
      },
      "required": [
        "failureType",
        "numberOfRetries"
      ]
    },
    "SchedulingConfig": {
      "type": "object",
      "properties": {
        "startTime": {
          "type": "string",
          "description": "The time a job will begin rollout of the job document to all devices in the target group for a job. The startTime can be scheduled up to a year in advance and must be scheduled a minimum of thirty minutes from the current time. The date and time format for the startTime is YYYY-MM-DD for the date and HH:MM for the time. For more information on the syntax for startTime when using an API command or the Command Line Interface, see Timestamp."
        },
        "endTime": {
          "type": "string",
          "description": "The time a job will stop rollout of the job document to all devices in the target group for a job. The endTime must take place no later than two years from the current time and be scheduled a minimum of thirty minutes from the current time. The minimum duration between startTime and endTime is thirty minutes. The maximum duration between startTime and endTime is two years. The date and time format for the endTime is YYYY-MM-DD for the date and HH:MM for the time. For more information on the syntax for endTime when using an API command or the Command Line Interface, see Timestamp."
        },
        "endBehavior": {
          "type": "string",
          "enum": [
            "STOP_ROLLOUT",
            "CANCEL",
            "FORCE_CANCEL"
          ],
          "description": "Specifies the end behavior for all job executions after a job reaches the selected endTime. If endTime is not selected when creating the job, then endBehavior does not apply."
        },
        "maintenanceWindows": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MaintenanceWindow"
          },
          "description": "An optional configuration within the SchedulingConfig to setup a recurring maintenance window with a predetermined start time and duration for the rollout of a job document to all devices in a target group for a job."
        }
      }
    },
    "Tag": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "The tag's key."
        },
        "Value": {
          "type": "string",
          "description": "The tag's value."
        }
      },
      "required": [
        "Key"
      ]
    },
    "TimeoutConfig": {
      "type": "object",
      "properties": {
        "inProgressTimeoutInMinutes": {
          "type": "integer",
          "description": "Specifies the amount of time, in minutes, this device has to finish execution of this job. The timeout interval can be anywhere between 1 minute and 7 days (1 to 10080 minutes). The in progress timer can't be updated and will apply to all job executions for the job. Whenever a job execution remains in the IN_PROGRESS status for longer than this interval, the job execution will fail and switch to the terminal TIMED_OUT status."
        }
      }
    }
  }
}