Ensuring idempotency - AWS Elemental MediaConvert API Reference
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.

Ensuring idempotency

Idempotency ensures that an API request completes only once. With idempotent requests, if the original request completes successfully, subsequent requests have no additional effect. This is useful to prevent duplicate jobs from being created when you interact with the AWS Elemental MediaConvert API.

The MediaConvert API supports idempotency with client request tokens. A client request token is a unique string that you specify when you make a create job request.

A client request token can be any string that includes up to 64 ASCII characters. If you reuse a client request token within one minute of a successful request, the API returns the job details of the original request instead.

The following Amazon CLI command creates an idempotent CreateJob request with the client request token example-token.

aws mediaconvert create-job --client-request-token example-token --endpoint-url https://abcd1234.mediaconvert.region-name-1.amazonaws.com --region region-name-1 --cli-input-json file://job.json