CloudFront Origin Request Policy API
The Origin Request Policy API from CloudFront — 3 operation(s) for origin request policy.
The Origin Request Policy API from CloudFront — 3 operation(s) for origin request policy.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/cloudfront:cloudfront-origin-request-policy-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.1.0
info:
title: Amazon CloudFront Origin Request Policy API
version: '2020-05-31'
description: Generated from AWS's published Smithy model for Amazon CloudFront. 6 operation(s).
contact:
name: Amazon Web Services
url: https://aws.amazon.com/contact-us/
license:
name: Apache 2.0
identifier: Apache-2.0
url: https://github.com/aws/api-models-aws/blob/main/LICENSE
servers:
- url: https://cloudfront.{region}.amazonaws.com
variables:
region:
default: us-east-1
security:
- sigv4: []
paths:
/2020-05-31/origin-request-policy:
post:
operationId: CreateOriginRequestPolicy
summary: Create Origin Request Policy
description: 'Creates an origin request policy. After you create an origin request policy, you can attach it to one
or more cache behaviors. When it''s attached to a cache behavior, the origin request policy determines the values
that CloudFront includes in requests that it sends to the origin. Each request that CloudFront sends to the origin
includes the following: The request body and the URL path (without the domain name) from the viewer request. The headers
that CloudFront automatically includes in every origin request, including Host, User-Agent, and X-Amz-Cf-Id. All HTTP
headers, cookies, and URL query strings that are specified in the cache policy or the origin request policy. These
can include items from the viewer request and, in the case of headers, additional ones that are added by CloudFront.
CloudFront sends a request when it can''t find a valid object in its cache that matches the request. If you want to
send values to the origin and also include them in the cache key, use CachePolicy. For more information about origin
request policies, see Controlling origin requests in the Amazon CloudFront Developer Guide.'
responses:
'200':
description: Success
content:
text/xml:
schema:
$ref: '#/components/schemas/CreateOriginRequestPolicyResult'
'403':
description: AccessDenied
content:
text/xml:
schema:
$ref: '#/components/schemas/AccessDenied'
'400':
description: InconsistentQuantities; InvalidArgument; TooManyCookiesInOriginRequestPolicy; TooManyHeadersInOriginRequestPolicy;
TooManyOriginRequestPolicies; TooManyQueryStringsInOriginRequestPolicy
content:
text/xml:
schema:
$ref: '#/components/schemas/InconsistentQuantities'
'409':
description: OriginRequestPolicyAlreadyExists
content:
text/xml:
schema:
$ref: '#/components/schemas/OriginRequestPolicyAlreadyExists'
requestBody:
content:
application/xml:
schema:
$ref: '#/components/schemas/CreateOriginRequestPolicyRequest'
tags:
- Origin Request Policy
get:
operationId: ListOriginRequestPolicies
summary: List Origin Request Policies
description: Gets a list of origin request policies. You can optionally apply a filter to return only the managed policies
created by Amazon Web Services, or only the custom policies created in your Amazon Web Services account. You can optionally
specify the maximum number of items to receive in the response. If the total number of items in the list exceeds the
maximum that you specify, or the default maximum, the response is paginated. To get the next page of items, send a
subsequent request that specifies the NextMarker value from the current response as the Marker value in the subsequent
request.
responses:
'200':
description: Success
content:
text/xml:
schema:
$ref: '#/components/schemas/ListOriginRequestPoliciesResult'
'403':
description: AccessDenied
content:
text/xml:
schema:
$ref: '#/components/schemas/AccessDenied'
'400':
description: InvalidArgument
content:
text/xml:
schema:
$ref: '#/components/schemas/InvalidArgument'
'404':
description: NoSuchOriginRequestPolicy
content:
text/xml:
schema:
$ref: '#/components/schemas/NoSuchOriginRequestPolicy'
requestBody:
content:
application/xml:
schema:
$ref: '#/components/schemas/ListOriginRequestPoliciesRequest'
tags:
- Origin Request Policy
/2020-05-31/origin-request-policy/{Id}:
delete:
operationId: DeleteOriginRequestPolicy
summary: Delete Origin Request Policy
description: Deletes an origin request policy. You cannot delete an origin request policy if it's attached to any cache
behaviors. First update your distributions to remove the origin request policy from all cache behaviors, then delete
the origin request policy. To delete an origin request policy, you must provide the policy's identifier and version.
To get the identifier, you can use ListOriginRequestPolicies or GetOriginRequestPolicy.
responses:
'200':
description: Success
content:
text/xml:
schema:
type: string
'403':
description: AccessDenied
content:
text/xml:
schema:
$ref: '#/components/schemas/AccessDenied'
'400':
description: IllegalDelete; InvalidIfMatchVersion
content:
text/xml:
schema:
$ref: '#/components/schemas/IllegalDelete'
'404':
description: NoSuchOriginRequestPolicy
content:
text/xml:
schema:
$ref: '#/components/schemas/NoSuchOriginRequestPolicy'
'409':
description: OriginRequestPolicyInUse
content:
text/xml:
schema:
$ref: '#/components/schemas/OriginRequestPolicyInUse'
'412':
description: PreconditionFailed
content:
text/xml:
schema:
$ref: '#/components/schemas/PreconditionFailed'
requestBody:
content:
application/xml:
schema:
$ref: '#/components/schemas/DeleteOriginRequestPolicyRequest'
tags:
- Origin Request Policy
get:
operationId: GetOriginRequestPolicy
summary: Get Origin Request Policy
description: 'Gets an origin request policy, including the following metadata: The policy''s identifier. The date and
time when the policy was last modified. To get an origin request policy, you must provide the policy''s identifier.
If the origin request policy is attached to a distribution''s cache behavior, you can get the policy''s identifier
using ListDistributions or GetDistribution. If the origin request policy is not attached to a cache behavior, you
can get the identifier using ListOriginRequestPolicies.'
responses:
'200':
description: Success
content:
text/xml:
schema:
$ref: '#/components/schemas/GetOriginRequestPolicyResult'
'403':
description: AccessDenied
content:
text/xml:
schema:
$ref: '#/components/schemas/AccessDenied'
'404':
description: NoSuchOriginRequestPolicy
content:
text/xml:
schema:
$ref: '#/components/schemas/NoSuchOriginRequestPolicy'
requestBody:
content:
application/xml:
schema:
$ref: '#/components/schemas/GetOriginRequestPolicyRequest'
tags:
- Origin Request Policy
put:
operationId: UpdateOriginRequestPolicy
summary: Update Origin Request Policy
description: 'Updates an origin request policy configuration. When you update an origin request policy configuration,
all the fields are updated with the values provided in the request. You cannot update some fields independent of others.
To update an origin request policy configuration: Use GetOriginRequestPolicyConfig to get the current configuration.
Locally modify the fields in the origin request policy configuration that you want to update. Call UpdateOriginRequestPolicy
by providing the entire origin request policy configuration, including the fields that you modified and those that
you didn''t.'
responses:
'200':
description: Success
content:
text/xml:
schema:
$ref: '#/components/schemas/UpdateOriginRequestPolicyResult'
'403':
description: AccessDenied
content:
text/xml:
schema:
$ref: '#/components/schemas/AccessDenied'
'400':
description: IllegalUpdate; InconsistentQuantities; InvalidArgument; InvalidIfMatchVersion; TooManyCookiesInOriginRequestPolicy;
TooManyHeadersInOriginRequestPolicy; TooManyQueryStringsInOriginRequestPolicy
content:
text/xml:
schema:
$ref: '#/components/schemas/IllegalUpdate'
'404':
description: NoSuchOriginRequestPolicy
content:
text/xml:
schema:
$ref: '#/components/schemas/NoSuchOriginRequestPolicy'
'409':
description: OriginRequestPolicyAlreadyExists
content:
text/xml:
schema:
$ref: '#/components/schemas/OriginRequestPolicyAlreadyExists'
'412':
description: PreconditionFailed
content:
text/xml:
schema:
$ref: '#/components/schemas/PreconditionFailed'
requestBody:
content:
application/xml:
schema:
$ref: '#/components/schemas/UpdateOriginRequestPolicyRequest'
tags:
- Origin Request Policy
/2020-05-31/origin-request-policy/{Id}/config:
get:
operationId: GetOriginRequestPolicyConfig
summary: Get Origin Request Policy Config
description: Gets an origin request policy configuration. To get an origin request policy configuration, you must provide
the policy's identifier. If the origin request policy is attached to a distribution's cache behavior, you can get
the policy's identifier using ListDistributions or GetDistribution. If the origin request policy is not attached to
a cache behavior, you can get the identifier using ListOriginRequestPolicies.
responses:
'200':
description: Success
content:
text/xml:
schema:
$ref: '#/components/schemas/GetOriginRequestPolicyConfigResult'
'403':
description: AccessDenied
content:
text/xml:
schema:
$ref: '#/components/schemas/AccessDenied'
'404':
description: NoSuchOriginRequestPolicy
content:
text/xml:
schema:
$ref: '#/components/schemas/NoSuchOriginRequestPolicy'
requestBody:
content:
application/xml:
schema:
$ref: '#/components/schemas/GetOriginRequestPolicyConfigRequest'
tags:
- Origin Request Policy
components:
securitySchemes:
sigv4:
type: apiKey
in: header
name: Authorization
description: AWS Signature Version 4. The Authorization header carries an AWS4-HMAC-SHA256 signature over the canonical
request, with X-Amz-Date (and X-Amz-Security-Token for temporary credentials). Not a bearer token.
x-aws-sigv4:
signingName: cloudfront
schemas:
AccessDenied:
type: object
properties:
Message:
type: string
CookieNames:
type: object
properties:
Quantity:
type: integer
description: The number of cookie names in the Items list.
Items:
type: array
items:
type: string
description: A list of cookie names.
required:
- Quantity
CreateOriginRequestPolicyRequest:
type: object
properties:
OriginRequestPolicyConfig:
$ref: '#/components/schemas/OriginRequestPolicyConfig'
required:
- OriginRequestPolicyConfig
CreateOriginRequestPolicyResult:
type: object
properties:
OriginRequestPolicy:
$ref: '#/components/schemas/OriginRequestPolicy'
Location:
type: string
description: The fully qualified URI of the origin request policy just created.
ETag:
type: string
description: The current version of the origin request policy.
DeleteOriginRequestPolicyRequest:
type: object
properties:
Id:
type: string
description: The unique identifier for the origin request policy that you are deleting. To get the identifier, you
can use ListOriginRequestPolicies.
IfMatch:
type: string
description: The version of the origin request policy that you are deleting. The version is the origin request policy's
ETag value, which you can get using ListOriginRequestPolicies, GetOriginRequestPolicy, or GetOriginRequestPolicyConfig.
required:
- Id
GetOriginRequestPolicyConfigRequest:
type: object
properties:
Id:
type: string
description: The unique identifier for the origin request policy. If the origin request policy is attached to a
distribution's cache behavior, you can get the policy's identifier using ListDistributions or GetDistribution.
If the origin request policy is not attached to a cache behavior, you can get the identifier using ListOriginRequestPolicies.
required:
- Id
GetOriginRequestPolicyConfigResult:
type: object
properties:
OriginRequestPolicyConfig:
$ref: '#/components/schemas/OriginRequestPolicyConfig'
ETag:
type: string
description: The current version of the origin request policy.
GetOriginRequestPolicyRequest:
type: object
properties:
Id:
type: string
description: The unique identifier for the origin request policy. If the origin request policy is attached to a
distribution's cache behavior, you can get the policy's identifier using ListDistributions or GetDistribution.
If the origin request policy is not attached to a cache behavior, you can get the identifier using ListOriginRequestPolicies.
required:
- Id
GetOriginRequestPolicyResult:
type: object
properties:
OriginRequestPolicy:
$ref: '#/components/schemas/OriginRequestPolicy'
ETag:
type: string
description: The current version of the origin request policy.
Headers:
type: object
properties:
Quantity:
type: integer
description: The number of header names in the Items list.
Items:
type: array
items:
type: string
description: A list of HTTP header names.
required:
- Quantity
IllegalDelete:
type: object
properties:
Message:
type: string
IllegalUpdate:
type: object
properties:
Message:
type: string
InconsistentQuantities:
type: object
properties:
Message:
type: string
InvalidArgument:
type: object
properties:
Message:
type: string
ListOriginRequestPoliciesRequest:
type: object
properties:
Type:
type: string
enum:
- managed
- custom
description: 'A filter to return only the specified kinds of origin request policies. Valid values are: managed
– Returns only the managed policies created by Amazon Web Services. custom – Returns only the custom policies
created in your Amazon Web Services account.'
Marker:
type: string
description: Use this field when paginating results to indicate where to begin in your list of origin request policies.
The response includes origin request policies in the list that occur after the marker. To get the next page of
the list, set this field's value to the value of NextMarker from the current page's response.
MaxItems:
type: integer
description: The maximum number of origin request policies that you want in the response.
ListOriginRequestPoliciesResult:
type: object
properties:
OriginRequestPolicyList:
$ref: '#/components/schemas/OriginRequestPolicyList'
NoSuchOriginRequestPolicy:
type: object
properties:
Message:
type: string
OriginRequestPolicy:
type: object
properties:
Id:
type: string
description: The unique identifier for the origin request policy.
LastModifiedTime:
type: string
format: date-time
description: The date and time when the origin request policy was last modified.
OriginRequestPolicyConfig:
$ref: '#/components/schemas/OriginRequestPolicyConfig'
required:
- Id
- LastModifiedTime
- OriginRequestPolicyConfig
OriginRequestPolicyAlreadyExists:
type: object
properties:
Message:
type: string
OriginRequestPolicyConfig:
type: object
properties:
Comment:
type: string
description: A comment to describe the origin request policy. The comment cannot be longer than 128 characters.
Name:
type: string
description: A unique name to identify the origin request policy.
HeadersConfig:
$ref: '#/components/schemas/OriginRequestPolicyHeadersConfig'
CookiesConfig:
$ref: '#/components/schemas/OriginRequestPolicyCookiesConfig'
QueryStringsConfig:
$ref: '#/components/schemas/OriginRequestPolicyQueryStringsConfig'
required:
- Name
- HeadersConfig
- CookiesConfig
- QueryStringsConfig
OriginRequestPolicyCookiesConfig:
type: object
properties:
CookieBehavior:
type: string
enum:
- none
- whitelist
- all
- allExcept
description: 'Determines whether cookies in viewer requests are included in requests that CloudFront sends to the
origin. Valid values are: none – No cookies in viewer requests are included in requests that CloudFront sends
to the origin. Even when this field is set to none, any cookies that are listed in a CachePolicy are included
in origin requests. whitelist – Only the cookies in viewer requests that are listed in the CookieNames type are
included in requests that CloudFront sends to the origin. all – All cookies in viewer requests are included in
requests that CloudFront sends to the origin. allExcept –'
Cookies:
$ref: '#/components/schemas/CookieNames'
required:
- CookieBehavior
OriginRequestPolicyHeadersConfig:
type: object
properties:
HeaderBehavior:
type: string
enum:
- none
- whitelist
- allViewer
- allViewerAndWhitelistCloudFront
- allExcept
description: 'Determines whether any HTTP headers are included in requests that CloudFront sends to the origin.
Valid values are: none – No HTTP headers in viewer requests are included in requests that CloudFront sends to
the origin. Even when this field is set to none, any headers that are listed in a CachePolicy are included in
origin requests. whitelist – Only the HTTP headers that are listed in the Headers type are included in requests
that CloudFront sends to the origin. allViewer – All HTTP headers in viewer requests are included in requests
that CloudFront sends to the origin. allViewerAndWhitelistCl'
Headers:
$ref: '#/components/schemas/Headers'
required:
- HeaderBehavior
OriginRequestPolicyInUse:
type: object
properties:
Message:
type: string
OriginRequestPolicyList:
type: object
properties:
NextMarker:
type: string
description: If there are more items in the list than are in this response, this element is present. It contains
the value that you should use in the Marker field of a subsequent request to continue listing origin request policies
where you left off.
MaxItems:
type: integer
description: The maximum number of origin request policies requested.
Quantity:
type: integer
description: The total number of origin request policies returned in the response.
Items:
type: array
items:
$ref: '#/components/schemas/OriginRequestPolicySummary'
description: Contains the origin request policies in the list.
required:
- MaxItems
- Quantity
OriginRequestPolicyQueryStringsConfig:
type: object
properties:
QueryStringBehavior:
type: string
enum:
- none
- whitelist
- all
- allExcept
description: 'Determines whether any URL query strings in viewer requests are included in requests that CloudFront
sends to the origin. Valid values are: none – No query strings in viewer requests are included in requests that
CloudFront sends to the origin. Even when this field is set to none, any query strings that are listed in a CachePolicy
are included in origin requests. whitelist – Only the query strings in viewer requests that are listed in the
QueryStringNames type are included in requests that CloudFront sends to the origin. all – All query strings in
viewer requests are included in requests that '
QueryStrings:
$ref: '#/components/schemas/QueryStringNames'
required:
- QueryStringBehavior
OriginRequestPolicySummary:
type: object
properties:
Type:
type: string
enum:
- managed
- custom
description: The type of origin request policy, either managed (created by Amazon Web Services) or custom (created
in this Amazon Web Services account).
OriginRequestPolicy:
$ref: '#/components/schemas/OriginRequestPolicy'
required:
- Type
- OriginRequestPolicy
PreconditionFailed:
type: object
properties:
Message:
type: string
QueryStringNames:
type: object
properties:
Quantity:
type: integer
description: The number of query string names in the Items list.
Items:
type: array
items:
type: string
description: A list of query string names.
required:
- Quantity
UpdateOriginRequestPolicyRequest:
type: object
properties:
OriginRequestPolicyConfig:
$ref: '#/components/schemas/OriginRequestPolicyConfig'
Id:
type: string
description: The unique identifier for the origin request policy that you are updating. The identifier is returned
in a cache behavior's OriginRequestPolicyId field in the response to GetDistributionConfig.
IfMatch:
type: string
description: The version of the origin request policy that you are updating. The version is returned in the origin
request policy's ETag field in the response to GetOriginRequestPolicyConfig.
required:
- OriginRequestPolicyConfig
- Id
UpdateOriginRequestPolicyResult:
type: object
properties:
OriginRequestPolicy:
$ref: '#/components/schemas/OriginRequestPolicy'
ETag:
type: string
description: The current version of the origin request policy.
x-provenance:
method: harvested
publisher: Amazon Web Services
source: https://raw.githubusercontent.com/aws/api-models-aws/582e55931c45b944739742a2c1620b6026dd2d13/models/cloudfront/service/2020-05-31/cloudfront-2020-05-31.json
note: converted by smithy-to-openapi.py from AWS's Smithy model (roadmap#1001)