UpdateJobExecution - Amazon IoT
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


Updates the status of a job execution.

Requires permission to access the UpdateJobExecution action.

Request Syntax

POST /things/thingName/jobs/jobId?namespaceId=namespaceId HTTP/1.1 Content-type: application/json { "executionNumber": number, "expectedVersion": number, "includeJobDocument": boolean, "includeJobExecutionState": boolean, "status": "string", "statusDetails": { "string" : "string" }, "stepTimeoutInMinutes": number }

URI Request Parameters

The request uses the following URI parameters.


The unique identifier assigned to this job when it was created.

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: [a-zA-Z0-9_-]+

Required: Yes


The namespace used to indicate that a job is a customer-managed job.

When you specify a value for this parameter, Amazon IoT Core sends jobs notifications to MQTT topics that contain the value in the following format.



The namespaceId feature is only supported by Amazon IoT Greengrass at this time. For more information, see Setting up Amazon IoT Greengrass core devices.

Pattern: [a-zA-Z0-9_-]+


The name of the thing associated with the device.

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [a-zA-Z0-9:_-]+

Required: Yes

Request Body

The request accepts the following data in JSON format.


Optional. A number that identifies a particular job execution on a particular device.

Type: Long

Required: No


Optional. The expected current version of the job execution. Each time you update the job execution, its version is incremented. If the version of the job execution stored in Jobs does not match, the update is rejected with a VersionMismatch error, and an ErrorResponse that contains the current job execution status data is returned. (This makes it unnecessary to perform a separate DescribeJobExecution request in order to obtain the job execution status data.)

Type: Long

Required: No


Optional. When set to true, the response contains the job document. The default is false.

Type: Boolean

Required: No


Optional. When included and set to true, the response contains the JobExecutionState data. The default is false.

Type: Boolean

Required: No


The new status for the job execution (IN_PROGRESS, FAILED, SUCCESS, or REJECTED). This must be specified on every update.

Type: String


Required: Yes


Optional. A collection of name/value pairs that describe the status of the job execution. If not specified, the statusDetails are unchanged.

The maximum length of the value in the name/value pair is 1,024 characters.

Type: String to string map

Key Length Constraints: Minimum length of 1. Maximum length of 128.

Key Pattern: [a-zA-Z0-9:_-]+

Value Length Constraints: Minimum length of 1.

Value Pattern: [^\p{C}]+

Required: No


Specifies the amount of time this device has to finish execution of this job. If the job execution status is not set to a terminal state before this timer expires, or before the timer is reset (by again calling UpdateJobExecution, setting the status to IN_PROGRESS, and specifying a new timeout value in this field) the job execution status will be automatically set to TIMED_OUT. Note that setting or resetting the step timeout has no effect on the in progress timeout that may have been specified when the job was created (CreateJob using field timeoutConfig).

Valid values for this parameter range from 1 to 10080 (1 minute to 7 days). A value of -1 is also valid and will cancel the current step timer (created by an earlier use of UpdateJobExecutionRequest).

Type: Long

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "executionState": { "status": "string", "statusDetails": { "string" : "string" }, "versionNumber": number }, "jobDocument": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.


A JobExecutionState object.

Type: JobExecutionState object


The contents of the Job Documents.

Type: String

Length Constraints: Maximum length of 32768.



The certificate is invalid.

HTTP Status Code: 400


The contents of the request were invalid.

HTTP Status Code: 400


An update attempted to change the job execution to a state that is invalid because of the job execution's current state (for example, an attempt to change a request in state SUCCESS to state IN_PROGRESS). In this case, the body of the error message also contains the executionState field.

HTTP Status Code: 409


The specified resource does not exist.

HTTP Status Code: 404


The service is temporarily unavailable.

HTTP Status Code: 503


The rate exceeds the limit.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: