Menu
Amazon CloudFront
API Reference (API Version 2016-09-29)

CreateInvalidation

Create a new invalidation.

Request Syntax

POST /2016-09-29/distribution/DistributionId/invalidation HTTP/1.1
<?xml version="1.0" encoding="UTF-8"?>
<CreateInvalidationRequest>
   <InvalidationBatch>
      <CallerReference>string</CallerReference>
      <Paths>
         <Items>
            <Path>string</Path></Items>
         <Quantity>integer</Quantity>
      </Paths>
   </InvalidationBatch>
</CreateInvalidationRequest>

URI Request Parameters

The request requires the following URI parameters.

DistributionId

The distribution's id.

Request Body

The request requires the following data in XML format.

CreateInvalidationRequest

Root level tag for the CreateInvalidationRequest parameters.

Required: Yes

InvalidationBatch

The batch information for the invalidation.

Type: InvalidationBatch object

Required: Yes

Response Syntax

HTTP/1.1 201
Location: Location
<?xml version="1.0" encoding="UTF-8"?>
<CreateInvalidationResult>
   <Invalidation>
      <CreateTime>timestamp</CreateTime>
      <Id>string</Id>
      <InvalidationBatch>
         <CallerReference>string</CallerReference>
         <Paths>
            <Items>
               <Path>string</Path></Items>
            <Quantity>integer</Quantity>
         </Paths>
      </InvalidationBatch>
      <Status>string</Status>
   </Invalidation>
</CreateInvalidationResult>

Response Elements

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

The response returns the following HTTP headers.

Location

The fully qualified URI of the distribution and invalidation batch request, including the Invalidation ID.

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

CreateInvalidationResult

Root level tag for the CreateInvalidationResult parameters.

Required: Yes

Invalidation

The invalidation's information.

Type: Invalidation object

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDenied

Access denied.

HTTP Status Code: 403

BatchTooLarge

HTTP Status Code: 413

InconsistentQuantities

The value of Quantity and the size of Items do not match.

HTTP Status Code: 400

InvalidArgument

The argument is invalid.

HTTP Status Code: 400

MissingBody

This operation requires a body. Ensure that the body is present and the Content-Type header is set.

HTTP Status Code: 400

NoSuchDistribution

The specified distribution does not exist.

HTTP Status Code: 404

TooManyInvalidationsInProgress

You have exceeded the maximum number of allowable InProgress invalidation batch requests, or invalidation objects.

HTTP Status Code: 400