

# AWS IoT jobs data
<a name="API_Operations_AWS_IoT_Jobs_Data_Plane"></a>

The following actions are supported by AWS IoT jobs data:
+  [DescribeJobExecution](API_iot-jobs-data_DescribeJobExecution.md) 
+  [GetPendingJobExecutions](API_iot-jobs-data_GetPendingJobExecutions.md) 
+  [StartCommandExecution](API_iot-jobs-data_StartCommandExecution.md) 
+  [StartNextPendingJobExecution](API_iot-jobs-data_StartNextPendingJobExecution.md) 
+  [UpdateJobExecution](API_iot-jobs-data_UpdateJobExecution.md) 

# DescribeJobExecution
<a name="API_iot-jobs-data_DescribeJobExecution"></a>

Gets details of a job execution.

Requires permission to access the [DescribeJobExecution](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) action.

## Request Syntax
<a name="API_iot-jobs-data_DescribeJobExecution_RequestSyntax"></a>

```
GET /things/thingName/jobs/jobId?executionNumber=executionNumber&includeJobDocument=includeJobDocument HTTP/1.1
```

## URI Request Parameters
<a name="API_iot-jobs-data_DescribeJobExecution_RequestParameters"></a>

The request uses the following URI parameters.

 ** [executionNumber](#API_iot-jobs-data_DescribeJobExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_DescribeJobExecution-request-uri-executionNumber"></a>
Optional. A number that identifies a particular job execution on a particular device. If not specified, the latest job execution is returned.

 ** [includeJobDocument](#API_iot-jobs-data_DescribeJobExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_DescribeJobExecution-request-uri-includeJobDocument"></a>
Optional. Unless set to false, the response contains the job document. The default is true.

 ** [jobId](#API_iot-jobs-data_DescribeJobExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_DescribeJobExecution-request-uri-jobId"></a>
The unique identifier assigned to this job when it was created.  
Pattern: `[a-zA-Z0-9_-]+|^\$next`   
Required: Yes

 ** [thingName](#API_iot-jobs-data_DescribeJobExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_DescribeJobExecution-request-uri-thingName"></a>
The thing name associated with the device the job execution is running on.  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `[a-zA-Z0-9:_-]+`   
Required: Yes

## Request Body
<a name="API_iot-jobs-data_DescribeJobExecution_RequestBody"></a>

The request does not have a request body.

## Response Syntax
<a name="API_iot-jobs-data_DescribeJobExecution_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "execution": { 
      "approximateSecondsBeforeTimedOut": number,
      "executionNumber": number,
      "jobDocument": "string",
      "jobId": "string",
      "lastUpdatedAt": number,
      "queuedAt": number,
      "startedAt": number,
      "status": "string",
      "statusDetails": { 
         "string" : "string" 
      },
      "thingName": "string",
      "versionNumber": number
   }
}
```

## Response Elements
<a name="API_iot-jobs-data_DescribeJobExecution_ResponseElements"></a>

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

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

 ** [execution](#API_iot-jobs-data_DescribeJobExecution_ResponseSyntax) **   <a name="iot-iot-jobs-data_DescribeJobExecution-response-execution"></a>
Contains data about a job execution.  
Type: [JobExecution](API_iot-jobs-data_JobExecution.md) object

## Errors
<a name="API_iot-jobs-data_DescribeJobExecution_Errors"></a>

 ** CertificateValidationException **   
The certificate is invalid.    
 ** message **   
Additional information about the exception.
HTTP Status Code: 400

 ** InvalidRequestException **   
The contents of the request were invalid.    
 ** message **   
The message for the exception.
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.    
 ** message **   
The message for the exception.
HTTP Status Code: 404

 ** ServiceUnavailableException **   
The service is temporarily unavailable.    
 ** message **   
The message for the exception.
HTTP Status Code: 503

 ** TerminalStateException **   
The job is in a terminal state.  
HTTP Status Code: 410

 ** ThrottlingException **   
The rate exceeds the limit.    
 ** message **   
The message associated with the exception.  
 ** payload **   
The payload associated with the exception.
HTTP Status Code: 400

## See Also
<a name="API_iot-jobs-data_DescribeJobExecution_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/iot-jobs-data-2017-09-29/DescribeJobExecution) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iot-jobs-data-2017-09-29/DescribeJobExecution) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/iot-jobs-data-2017-09-29/DescribeJobExecution) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/iot-jobs-data-2017-09-29/DescribeJobExecution) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iot-jobs-data-2017-09-29/DescribeJobExecution) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iot-jobs-data-2017-09-29/DescribeJobExecution) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/iot-jobs-data-2017-09-29/DescribeJobExecution) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iot-jobs-data-2017-09-29/DescribeJobExecution) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/iot-jobs-data-2017-09-29/DescribeJobExecution) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iot-jobs-data-2017-09-29/DescribeJobExecution) 

# GetPendingJobExecutions
<a name="API_iot-jobs-data_GetPendingJobExecutions"></a>

Gets the list of all jobs for a thing that are not in a terminal status.

Requires permission to access the [GetPendingJobExecutions](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) action.

## Request Syntax
<a name="API_iot-jobs-data_GetPendingJobExecutions_RequestSyntax"></a>

```
GET /things/thingName/jobs HTTP/1.1
```

## URI Request Parameters
<a name="API_iot-jobs-data_GetPendingJobExecutions_RequestParameters"></a>

The request uses the following URI parameters.

 ** [thingName](#API_iot-jobs-data_GetPendingJobExecutions_RequestSyntax) **   <a name="iot-iot-jobs-data_GetPendingJobExecutions-request-uri-thingName"></a>
The name of the thing that is executing the job.  
Length Constraints: Minimum length of 1. Maximum length of 128.  
Pattern: `[a-zA-Z0-9:_-]+`   
Required: Yes

## Request Body
<a name="API_iot-jobs-data_GetPendingJobExecutions_RequestBody"></a>

The request does not have a request body.

## Response Syntax
<a name="API_iot-jobs-data_GetPendingJobExecutions_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "inProgressJobs": [ 
      { 
         "executionNumber": number,
         "jobId": "string",
         "lastUpdatedAt": number,
         "queuedAt": number,
         "startedAt": number,
         "versionNumber": number
      }
   ],
   "queuedJobs": [ 
      { 
         "executionNumber": number,
         "jobId": "string",
         "lastUpdatedAt": number,
         "queuedAt": number,
         "startedAt": number,
         "versionNumber": number
      }
   ]
}
```

## Response Elements
<a name="API_iot-jobs-data_GetPendingJobExecutions_ResponseElements"></a>

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

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

 ** [inProgressJobs](#API_iot-jobs-data_GetPendingJobExecutions_ResponseSyntax) **   <a name="iot-iot-jobs-data_GetPendingJobExecutions-response-inProgressJobs"></a>
A list of JobExecutionSummary objects with status IN\$1PROGRESS.  
Type: Array of [JobExecutionSummary](API_iot-jobs-data_JobExecutionSummary.md) objects

 ** [queuedJobs](#API_iot-jobs-data_GetPendingJobExecutions_ResponseSyntax) **   <a name="iot-iot-jobs-data_GetPendingJobExecutions-response-queuedJobs"></a>
A list of JobExecutionSummary objects with status QUEUED.  
Type: Array of [JobExecutionSummary](API_iot-jobs-data_JobExecutionSummary.md) objects

## Errors
<a name="API_iot-jobs-data_GetPendingJobExecutions_Errors"></a>

 ** CertificateValidationException **   
The certificate is invalid.    
 ** message **   
Additional information about the exception.
HTTP Status Code: 400

 ** InvalidRequestException **   
The contents of the request were invalid.    
 ** message **   
The message for the exception.
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.    
 ** message **   
The message for the exception.
HTTP Status Code: 404

 ** ServiceUnavailableException **   
The service is temporarily unavailable.    
 ** message **   
The message for the exception.
HTTP Status Code: 503

 ** ThrottlingException **   
The rate exceeds the limit.    
 ** message **   
The message associated with the exception.  
 ** payload **   
The payload associated with the exception.
HTTP Status Code: 400

## See Also
<a name="API_iot-jobs-data_GetPendingJobExecutions_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/iot-jobs-data-2017-09-29/GetPendingJobExecutions) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iot-jobs-data-2017-09-29/GetPendingJobExecutions) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/iot-jobs-data-2017-09-29/GetPendingJobExecutions) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/iot-jobs-data-2017-09-29/GetPendingJobExecutions) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iot-jobs-data-2017-09-29/GetPendingJobExecutions) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iot-jobs-data-2017-09-29/GetPendingJobExecutions) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/iot-jobs-data-2017-09-29/GetPendingJobExecutions) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iot-jobs-data-2017-09-29/GetPendingJobExecutions) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/iot-jobs-data-2017-09-29/GetPendingJobExecutions) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iot-jobs-data-2017-09-29/GetPendingJobExecutions) 

# StartCommandExecution
<a name="API_iot-jobs-data_StartCommandExecution"></a>

Using the command created with the `CreateCommand` API, start a command execution on a specific device.

**Note**  
The IAM permissions are derived from the `iot:StartCommandExecution` action. For more information on the IAM permissions policy statement, see [Start a command execution (AWS CLI) > Sample IAM policy](https://docs.aws.amazon.com/iot/latest/developerguide/iot-remote-command-execution-start-monitor.html#iot-remote-command-execution-start).

## Request Syntax
<a name="API_iot-jobs-data_StartCommandExecution_RequestSyntax"></a>

```
POST /command-executions HTTP/1.1
Content-type: application/json

{
   "clientToken": "string",
   "commandArn": "string",
   "executionTimeoutSeconds": number,
   "parameters": { 
      "string" : { 
         "B": boolean,
         "BIN": blob,
         "D": number,
         "I": number,
         "L": number,
         "S": "string",
         "UL": "string"
      }
   },
   "targetArn": "string"
}
```

## URI Request Parameters
<a name="API_iot-jobs-data_StartCommandExecution_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_iot-jobs-data_StartCommandExecution_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [clientToken](#API_iot-jobs-data_StartCommandExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_StartCommandExecution-request-clientToken"></a>
The client token is used to implement idempotency. It ensures that the request completes no more than one time. If you retry a request with the same token and the same parameters, the request will complete successfully. However, if you retry the request using the same token but different parameters, an HTTP 409 conflict occurs. If you omit this value, AWS SDKs will automatically generate a unique client request.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `^[\x21-\x7E]+$`   
Required: No

 ** [commandArn](#API_iot-jobs-data_StartCommandExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_StartCommandExecution-request-commandArn"></a>
The Amazon Resource Number (ARN) of the command. For example, `arn:aws:iot:<region>:<accountid>:command/<commandName>`   
Type: String  
Required: Yes

 ** [executionTimeoutSeconds](#API_iot-jobs-data_StartCommandExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_StartCommandExecution-request-executionTimeoutSeconds"></a>
Specifies the amount of time in second the device has to finish the command execution. A timer is started as soon as the command execution is created. If the command execution status is not set to another terminal state before the timer expires, it will automatically update to `TIMED_OUT`.  
Type: Long  
Valid Range: Minimum value of 1.  
Required: No

 ** [parameters](#API_iot-jobs-data_StartCommandExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_StartCommandExecution-request-parameters"></a>
A list of parameters that are required by the `StartCommandExecution` API when performing the command on a device.  
Type: String to [CommandParameterValue](API_iot-jobs-data_CommandParameterValue.md) object map  
Map Entries: Maximum number of items.  
Key Length Constraints: Minimum length of 1. Maximum length of 192.  
Key Pattern: `^[.$a-zA-Z0-9_-]+$`   
Required: No

 ** [targetArn](#API_iot-jobs-data_StartCommandExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_StartCommandExecution-request-targetArn"></a>
The Amazon Resource Number (ARN) of the device where the command execution is occurring.  
Type: String  
Length Constraints: Maximum length of 2048.  
Required: Yes

## Response Syntax
<a name="API_iot-jobs-data_StartCommandExecution_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "executionId": "string"
}
```

## Response Elements
<a name="API_iot-jobs-data_StartCommandExecution_ResponseElements"></a>

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

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

 ** [executionId](#API_iot-jobs-data_StartCommandExecution_ResponseSyntax) **   <a name="iot-iot-jobs-data_StartCommandExecution-response-executionId"></a>
A unique identifier for the command execution.  
Type: String  
Length Constraints: Minimum length of 1. Maximum length of 64.  
Pattern: `[a-zA-Z0-9_-]+` 

## Errors
<a name="API_iot-jobs-data_StartCommandExecution_Errors"></a>

 ** ConflictException **   
A conflict has occurred when performing the API request.    
 ** resourceId **   
A conflict occurred while performing the API request on the resource ID.
HTTP Status Code: 409

 ** InternalServerException **   
An internal server error occurred when performing the API request.  
HTTP Status Code: 500

 ** ResourceNotFoundException **   
The specified resource does not exist.    
 ** message **   
The message for the exception.
HTTP Status Code: 404

 ** ServiceQuotaExceededException **   
The service quota has been exceeded for this request.  
HTTP Status Code: 402

 ** ThrottlingException **   
The rate exceeds the limit.    
 ** message **   
The message associated with the exception.  
 ** payload **   
The payload associated with the exception.
HTTP Status Code: 400

 ** ValidationException **   
A validation error occurred when performing the API request.  
HTTP Status Code: 400

## See Also
<a name="API_iot-jobs-data_StartCommandExecution_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/iot-jobs-data-2017-09-29/StartCommandExecution) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iot-jobs-data-2017-09-29/StartCommandExecution) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/iot-jobs-data-2017-09-29/StartCommandExecution) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/iot-jobs-data-2017-09-29/StartCommandExecution) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iot-jobs-data-2017-09-29/StartCommandExecution) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iot-jobs-data-2017-09-29/StartCommandExecution) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/iot-jobs-data-2017-09-29/StartCommandExecution) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iot-jobs-data-2017-09-29/StartCommandExecution) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/iot-jobs-data-2017-09-29/StartCommandExecution) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iot-jobs-data-2017-09-29/StartCommandExecution) 

# StartNextPendingJobExecution
<a name="API_iot-jobs-data_StartNextPendingJobExecution"></a>

Gets and starts the next pending (status IN\$1PROGRESS or QUEUED) job execution for a thing.

Requires permission to access the [StartNextPendingJobExecution](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions) action.

## Request Syntax
<a name="API_iot-jobs-data_StartNextPendingJobExecution_RequestSyntax"></a>

```
PUT /things/thingName/jobs/$next HTTP/1.1
Content-type: application/json

{
   "statusDetails": { 
      "string" : "string" 
   },
   "stepTimeoutInMinutes": number
}
```

## URI Request Parameters
<a name="API_iot-jobs-data_StartNextPendingJobExecution_RequestParameters"></a>

The request uses the following URI parameters.

 ** [thingName](#API_iot-jobs-data_StartNextPendingJobExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_StartNextPendingJobExecution-request-uri-thingName"></a>
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
<a name="API_iot-jobs-data_StartNextPendingJobExecution_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [statusDetails](#API_iot-jobs-data_StartNextPendingJobExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_StartNextPendingJobExecution-request-statusDetails"></a>
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

 ** [stepTimeoutInMinutes](#API_iot-jobs-data_StartNextPendingJobExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_StartNextPendingJobExecution-request-stepTimeoutInMinutes"></a>
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 calling `UpdateJobExecution`, setting the status to `IN_PROGRESS`, and specifying a new timeout value in field `stepTimeoutInMinutes`) the job execution status will be automatically set to `TIMED_OUT`. Note that setting 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).  
Type: Long  
Required: No

## Response Syntax
<a name="API_iot-jobs-data_StartNextPendingJobExecution_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "execution": { 
      "approximateSecondsBeforeTimedOut": number,
      "executionNumber": number,
      "jobDocument": "string",
      "jobId": "string",
      "lastUpdatedAt": number,
      "queuedAt": number,
      "startedAt": number,
      "status": "string",
      "statusDetails": { 
         "string" : "string" 
      },
      "thingName": "string",
      "versionNumber": number
   }
}
```

## Response Elements
<a name="API_iot-jobs-data_StartNextPendingJobExecution_ResponseElements"></a>

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

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

 ** [execution](#API_iot-jobs-data_StartNextPendingJobExecution_ResponseSyntax) **   <a name="iot-iot-jobs-data_StartNextPendingJobExecution-response-execution"></a>
A JobExecution object.  
Type: [JobExecution](API_iot-jobs-data_JobExecution.md) object

## Errors
<a name="API_iot-jobs-data_StartNextPendingJobExecution_Errors"></a>

 ** CertificateValidationException **   
The certificate is invalid.    
 ** message **   
Additional information about the exception.
HTTP Status Code: 400

 ** InvalidRequestException **   
The contents of the request were invalid.    
 ** message **   
The message for the exception.
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The specified resource does not exist.    
 ** message **   
The message for the exception.
HTTP Status Code: 404

 ** ServiceUnavailableException **   
The service is temporarily unavailable.    
 ** message **   
The message for the exception.
HTTP Status Code: 503

 ** ThrottlingException **   
The rate exceeds the limit.    
 ** message **   
The message associated with the exception.  
 ** payload **   
The payload associated with the exception.
HTTP Status Code: 400

## See Also
<a name="API_iot-jobs-data_StartNextPendingJobExecution_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/iot-jobs-data-2017-09-29/StartNextPendingJobExecution) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iot-jobs-data-2017-09-29/StartNextPendingJobExecution) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/iot-jobs-data-2017-09-29/StartNextPendingJobExecution) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/iot-jobs-data-2017-09-29/StartNextPendingJobExecution) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iot-jobs-data-2017-09-29/StartNextPendingJobExecution) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iot-jobs-data-2017-09-29/StartNextPendingJobExecution) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/iot-jobs-data-2017-09-29/StartNextPendingJobExecution) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iot-jobs-data-2017-09-29/StartNextPendingJobExecution) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/iot-jobs-data-2017-09-29/StartNextPendingJobExecution) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iot-jobs-data-2017-09-29/StartNextPendingJobExecution) 

# UpdateJobExecution
<a name="API_iot-jobs-data_UpdateJobExecution"></a>

Updates the status of a job execution.

Requires permission to access the [UpdateJobExecution](https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiotjobsdataplane.html) action.

## Request Syntax
<a name="API_iot-jobs-data_UpdateJobExecution_RequestSyntax"></a>

```
POST /things/thingName/jobs/jobId 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
<a name="API_iot-jobs-data_UpdateJobExecution_RequestParameters"></a>

The request uses the following URI parameters.

 ** [jobId](#API_iot-jobs-data_UpdateJobExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_UpdateJobExecution-request-uri-jobId"></a>
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

 ** [thingName](#API_iot-jobs-data_UpdateJobExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_UpdateJobExecution-request-uri-thingName"></a>
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
<a name="API_iot-jobs-data_UpdateJobExecution_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [executionNumber](#API_iot-jobs-data_UpdateJobExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_UpdateJobExecution-request-executionNumber"></a>
Optional. A number that identifies a particular job execution on a particular device.  
Type: Long  
Required: No

 ** [expectedVersion](#API_iot-jobs-data_UpdateJobExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_UpdateJobExecution-request-expectedVersion"></a>
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

 ** [includeJobDocument](#API_iot-jobs-data_UpdateJobExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_UpdateJobExecution-request-includeJobDocument"></a>
Optional. When set to true, the response contains the job document. The default is false.  
Type: Boolean  
Required: No

 ** [includeJobExecutionState](#API_iot-jobs-data_UpdateJobExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_UpdateJobExecution-request-includeJobExecutionState"></a>
Optional. When included and set to true, the response contains the JobExecutionState data. The default is false.  
Type: Boolean  
Required: No

 ** [status](#API_iot-jobs-data_UpdateJobExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_UpdateJobExecution-request-status"></a>
The new status for the job execution (IN\$1PROGRESS, FAILED, SUCCESS, or REJECTED). This must be specified on every update.  
Type: String  
Valid Values: `QUEUED | IN_PROGRESS | SUCCEEDED | FAILED | TIMED_OUT | REJECTED | REMOVED | CANCELED`   
Required: Yes

 ** [statusDetails](#API_iot-jobs-data_UpdateJobExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_UpdateJobExecution-request-statusDetails"></a>
 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

 ** [stepTimeoutInMinutes](#API_iot-jobs-data_UpdateJobExecution_RequestSyntax) **   <a name="iot-iot-jobs-data_UpdateJobExecution-request-stepTimeoutInMinutes"></a>
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
<a name="API_iot-jobs-data_UpdateJobExecution_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "executionState": { 
      "status": "string",
      "statusDetails": { 
         "string" : "string" 
      },
      "versionNumber": number
   },
   "jobDocument": "string"
}
```

## Response Elements
<a name="API_iot-jobs-data_UpdateJobExecution_ResponseElements"></a>

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

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

 ** [executionState](#API_iot-jobs-data_UpdateJobExecution_ResponseSyntax) **   <a name="iot-iot-jobs-data_UpdateJobExecution-response-executionState"></a>
A JobExecutionState object.  
Type: [JobExecutionState](API_iot-jobs-data_JobExecutionState.md) object

 ** [jobDocument](#API_iot-jobs-data_UpdateJobExecution_ResponseSyntax) **   <a name="iot-iot-jobs-data_UpdateJobExecution-response-jobDocument"></a>
The contents of the Job Documents.  
Type: String  
Length Constraints: Maximum length of 32768.

## Errors
<a name="API_iot-jobs-data_UpdateJobExecution_Errors"></a>

 ** CertificateValidationException **   
The certificate is invalid.    
 ** message **   
Additional information about the exception.
HTTP Status Code: 400

 ** InvalidRequestException **   
The contents of the request were invalid.    
 ** message **   
The message for the exception.
HTTP Status Code: 400

 ** InvalidStateTransitionException **   
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\$1PROGRESS). In this case, the body of the error message also contains the executionState field.  
HTTP Status Code: 409

 ** ResourceNotFoundException **   
The specified resource does not exist.    
 ** message **   
The message for the exception.
HTTP Status Code: 404

 ** ServiceUnavailableException **   
The service is temporarily unavailable.    
 ** message **   
The message for the exception.
HTTP Status Code: 503

 ** ThrottlingException **   
The rate exceeds the limit.    
 ** message **   
The message associated with the exception.  
 ** payload **   
The payload associated with the exception.
HTTP Status Code: 400

## See Also
<a name="API_iot-jobs-data_UpdateJobExecution_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/iot-jobs-data-2017-09-29/UpdateJobExecution) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iot-jobs-data-2017-09-29/UpdateJobExecution) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/iot-jobs-data-2017-09-29/UpdateJobExecution) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/iot-jobs-data-2017-09-29/UpdateJobExecution) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iot-jobs-data-2017-09-29/UpdateJobExecution) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iot-jobs-data-2017-09-29/UpdateJobExecution) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/iot-jobs-data-2017-09-29/UpdateJobExecution) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iot-jobs-data-2017-09-29/UpdateJobExecution) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/iot-jobs-data-2017-09-29/UpdateJobExecution) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/iot-jobs-data-2017-09-29/UpdateJobExecution) 