Every API here is available over the APIs.io API and to AI agents over MCP.
MCP server
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
Tools for apis
7 MCP tools reach this
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.
All 92 tools →
Call it yourself
curl for this page
This API
curl "https://apis.io/api/v1/apis/cloudfront:cloudfront-functions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
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 Functions API
version: '2020-05-31'
description: Generated from AWS's published Smithy model for Amazon CloudFront. 8 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/function:
post:
operationId: CreateFunction
summary: Create Function
description: Creates a CloudFront function. To create a function, you provide the function code and some configuration
information about the function. The response contains an Amazon Resource Name (ARN) that uniquely identifies the function.
When you create a function, it's in the DEVELOPMENT stage. In this stage, you can test the function with TestFunction,
and update it with UpdateFunction. When you're ready to use your function with a CloudFront distribution, use PublishFunction
to copy the function from the DEVELOPMENT stage to LIVE. When it's live, you can attach the function to a distribution's
cache behavior, using the function's ARN.
responses:
'200':
description: Success
content:
text/xml:
schema:
$ref: '#/components/schemas/CreateFunctionResult'
example:
FunctionSummary:
Name: my-function-name
Status: UNPUBLISHED
FunctionConfig:
Comment: my-function-comment
Runtime: cloudfront-js-2.0
KeyValueStoreAssociations:
Quantity: 1
Items:
- KeyValueStoreARN: arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889
FunctionMetadata:
FunctionARN: arn:aws:cloudfront::123456789012:function/my-function-name
Stage: DEVELOPMENT
CreatedTime: '2023-11-07T19:53:50.334Z'
LastModifiedTime: '2023-11-07T19:53:50.334Z'
Location: https://cloudfront.amazonaws.com/2020-05-31/function/arn:aws:cloudfront::123456789012:function/my-function-name
ETag: ETVPDKIKX0DER
'409':
description: FunctionAlreadyExists
content:
text/xml:
schema:
$ref: '#/components/schemas/FunctionAlreadyExists'
'413':
description: FunctionSizeLimitExceeded
content:
text/xml:
schema:
$ref: '#/components/schemas/FunctionSizeLimitExceeded'
'400':
description: InvalidArgument; TooManyFunctions; UnsupportedOperation
content:
text/xml:
schema:
$ref: '#/components/schemas/InvalidArgument'
requestBody:
content:
application/xml:
schema:
$ref: '#/components/schemas/CreateFunctionRequest'
example:
Name: my-function-name
FunctionConfig:
Comment: my-function-comment
Runtime: cloudfront-js-2.0
KeyValueStoreAssociations:
Quantity: 1
Items:
- KeyValueStoreARN: arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889
FunctionCode: function-code.js
tags:
- Functions
get:
operationId: ListFunctions
summary: List Functions
description: Gets a list of all CloudFront functions in your Amazon Web Services account. You can optionally apply a
filter to return only the functions that are in the specified stage, either DEVELOPMENT or LIVE. 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/ListFunctionsResult'
'400':
description: InvalidArgument; UnsupportedOperation
content:
text/xml:
schema:
$ref: '#/components/schemas/InvalidArgument'
requestBody:
content:
application/xml:
schema:
$ref: '#/components/schemas/ListFunctionsRequest'
tags:
- Functions
/2020-05-31/function/{Name}:
delete:
operationId: DeleteFunction
summary: Delete Function
description: Deletes a CloudFront function. You cannot delete a function if it's associated with a cache behavior. First,
update your distributions to remove the function association from all cache behaviors, then delete the function. To
delete a function, you must provide the function's name and version (ETag value). To get these values, you can use
ListFunctions and DescribeFunction.
responses:
'200':
description: Success
content:
text/xml:
schema:
type: string
'409':
description: FunctionInUse
content:
text/xml:
schema:
$ref: '#/components/schemas/FunctionInUse'
'400':
description: InvalidIfMatchVersion; UnsupportedOperation
content:
text/xml:
schema:
$ref: '#/components/schemas/InvalidIfMatchVersion'
'404':
description: NoSuchFunctionExists
content:
text/xml:
schema:
$ref: '#/components/schemas/NoSuchFunctionExists'
'412':
description: PreconditionFailed
content:
text/xml:
schema:
$ref: '#/components/schemas/PreconditionFailed'
requestBody:
content:
application/xml:
schema:
$ref: '#/components/schemas/DeleteFunctionRequest'
tags:
- Functions
get:
operationId: GetFunction
summary: Get Function
description: Gets the code of a CloudFront function. To get configuration information and metadata about a function,
use DescribeFunction. To get a function's code, you must provide the function's name and stage. To get these values,
you can use ListFunctions.
responses:
'200':
description: Success
content:
text/xml:
schema:
$ref: '#/components/schemas/GetFunctionResult'
'404':
description: NoSuchFunctionExists
content:
text/xml:
schema:
$ref: '#/components/schemas/NoSuchFunctionExists'
'400':
description: UnsupportedOperation
content:
text/xml:
schema:
$ref: '#/components/schemas/UnsupportedOperation'
requestBody:
content:
application/xml:
schema:
$ref: '#/components/schemas/GetFunctionRequest'
tags:
- Functions
put:
operationId: UpdateFunction
summary: Update Function
description: Updates a CloudFront function. You can update a function's code or the comment that describes the function.
You cannot update a function's name. To update a function, you provide the function's name and version (ETag value)
along with the updated function code. To get the name and version, you can use ListFunctions and DescribeFunction.
responses:
'200':
description: Success
content:
text/xml:
schema:
$ref: '#/components/schemas/UpdateFunctionResult'
example:
FunctionSummary:
Name: my-function-name
Status: UNPUBLISHED
FunctionConfig:
Comment: my-changed-comment
Runtime: cloudfront-js-2.0
KeyValueStoreAssociations:
Quantity: 1
Items:
- KeyValueStoreARN: arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889
FunctionMetadata:
FunctionARN: arn:aws:cloudfront::123456789012:function/my-function-name
Stage: DEVELOPMENT
CreatedTime: '2023-11-07T19:53:50.334Z'
LastModifiedTime: '2023-11-07T20:01:37.174Z'
ETag: E3UN6WX5RRO2AG
'413':
description: FunctionSizeLimitExceeded
content:
text/xml:
schema:
$ref: '#/components/schemas/FunctionSizeLimitExceeded'
'400':
description: InvalidArgument; InvalidIfMatchVersion; UnsupportedOperation
content:
text/xml:
schema:
$ref: '#/components/schemas/InvalidArgument'
'404':
description: NoSuchFunctionExists
content:
text/xml:
schema:
$ref: '#/components/schemas/NoSuchFunctionExists'
'412':
description: PreconditionFailed
content:
text/xml:
schema:
$ref: '#/components/schemas/PreconditionFailed'
requestBody:
content:
application/xml:
schema:
$ref: '#/components/schemas/UpdateFunctionRequest'
example:
Name: my-function-name
FunctionConfig:
Comment: my-changed-comment
Runtime: cloudfront-js-2.0
KeyValueStoreAssociations:
Quantity: 1
Items:
- KeyValueStoreARN: arn:aws:cloudfront::123456789012:key-value-store/54947df8-0e9e-4471-a2f9-9af509fb5889
FunctionCode: function-code-changed.js
IfMatch: ETVPDKIKX0DER
tags:
- Functions
/2020-05-31/function/{Name}/describe:
get:
operationId: DescribeFunction
summary: Describe Function
description: Gets configuration information and metadata about a CloudFront function, but not the function's code. To
get a function's code, use GetFunction. To get configuration information and metadata about a function, you must provide
the function's name and stage. To get these values, you can use ListFunctions.
responses:
'200':
description: Success
content:
text/xml:
schema:
$ref: '#/components/schemas/DescribeFunctionResult'
'404':
description: NoSuchFunctionExists
content:
text/xml:
schema:
$ref: '#/components/schemas/NoSuchFunctionExists'
'400':
description: UnsupportedOperation
content:
text/xml:
schema:
$ref: '#/components/schemas/UnsupportedOperation'
requestBody:
content:
application/xml:
schema:
$ref: '#/components/schemas/DescribeFunctionRequest'
tags:
- Functions
/2020-05-31/function/{Name}/publish:
post:
operationId: PublishFunction
summary: Publish Function
description: Publishes a CloudFront function by copying the function code from the DEVELOPMENT stage to LIVE. This automatically
updates all cache behaviors that are using this function to use the newly published copy in the LIVE stage. When a
function is published to the LIVE stage, you can attach the function to a distribution's cache behavior, using the
function's Amazon Resource Name (ARN). To publish a function, you must provide the function's name and version (ETag
value). To get these values, you can use ListFunctions and DescribeFunction.
responses:
'200':
description: Success
content:
text/xml:
schema:
$ref: '#/components/schemas/PublishFunctionResult'
'400':
description: InvalidArgument; InvalidIfMatchVersion; UnsupportedOperation
content:
text/xml:
schema:
$ref: '#/components/schemas/InvalidArgument'
'404':
description: NoSuchFunctionExists
content:
text/xml:
schema:
$ref: '#/components/schemas/NoSuchFunctionExists'
'412':
description: PreconditionFailed
content:
text/xml:
schema:
$ref: '#/components/schemas/PreconditionFailed'
requestBody:
content:
application/xml:
schema:
$ref: '#/components/schemas/PublishFunctionRequest'
tags:
- Functions
/2020-05-31/function/{Name}/test:
post:
operationId: TestFunction
summary: Test Function
description: Tests a CloudFront function. To test a function, you provide an event object that represents an HTTP request
or response that your CloudFront distribution could receive in production. CloudFront runs the function, passing it
the event object that you provided, and returns the function's result (the modified event object) in the response.
The response also contains function logs and error messages, if any exist. For more information about testing functions,
see Testing functions in the Amazon CloudFront Developer Guide. To test a function, you provide the function's name
and version (ETag value) along with the event object. To get the function's name and version, you can use ListFunctions
and DescribeFunction.
responses:
'200':
description: Success
content:
text/xml:
schema:
$ref: '#/components/schemas/TestFunctionResult'
'400':
description: InvalidArgument; InvalidIfMatchVersion; UnsupportedOperation
content:
text/xml:
schema:
$ref: '#/components/schemas/InvalidArgument'
'404':
description: NoSuchFunctionExists
content:
text/xml:
schema:
$ref: '#/components/schemas/NoSuchFunctionExists'
'500':
description: TestFunctionFailed
content:
text/xml:
schema:
$ref: '#/components/schemas/TestFunctionFailed'
requestBody:
content:
application/xml:
schema:
$ref: '#/components/schemas/TestFunctionRequest'
tags:
- Functions
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:
CreateFunctionRequest:
type: object
properties:
Name:
type: string
description: A name to identify the function.
FunctionConfig:
$ref: '#/components/schemas/FunctionConfig'
FunctionCode:
type: string
format: byte
description: The function code. For more information about writing a CloudFront function, see Writing function code
for CloudFront Functions in the Amazon CloudFront Developer Guide.
Tags:
$ref: '#/components/schemas/Tags'
required:
- Name
- FunctionConfig
- FunctionCode
CreateFunctionResult:
type: object
properties:
FunctionSummary:
$ref: '#/components/schemas/FunctionSummary'
Location:
type: string
description: The URL of the CloudFront function. Use the URL to manage the function with the CloudFront API.
ETag:
type: string
description: The version identifier for the current version of the CloudFront function.
DeleteFunctionRequest:
type: object
properties:
Name:
type: string
description: The name of the function that you are deleting.
IfMatch:
type: string
description: The current version (ETag value) of the function that you are deleting, which you can get using DescribeFunction.
required:
- Name
- IfMatch
DescribeFunctionRequest:
type: object
properties:
Name:
type: string
description: The name of the function that you are getting information about.
Stage:
type: string
enum:
- DEVELOPMENT
- LIVE
description: The function's stage, either DEVELOPMENT or LIVE.
required:
- Name
DescribeFunctionResult:
type: object
properties:
FunctionSummary:
$ref: '#/components/schemas/FunctionSummary'
ETag:
type: string
description: The version identifier for the current version of the CloudFront function.
FunctionAlreadyExists:
type: object
properties:
Message:
type: string
FunctionConfig:
type: object
properties:
Comment:
type: string
description: A comment to describe the function.
Runtime:
type: string
enum:
- cloudfront-js-1.0
- cloudfront-js-2.0
description: The function's runtime environment version.
KeyValueStoreAssociations:
$ref: '#/components/schemas/KeyValueStoreAssociations'
required:
- Comment
- Runtime
FunctionInUse:
type: object
properties:
Message:
type: string
FunctionList:
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 functions where
you left off.
MaxItems:
type: integer
description: The maximum number of functions requested.
Quantity:
type: integer
description: The number of functions returned in the response.
Items:
type: array
items:
$ref: '#/components/schemas/FunctionSummary'
description: Contains the functions in the list.
required:
- MaxItems
- Quantity
FunctionMetadata:
type: object
properties:
FunctionARN:
type: string
description: The Amazon Resource Name (ARN) of the function. The ARN uniquely identifies the function.
Stage:
type: string
enum:
- DEVELOPMENT
- LIVE
description: The stage that the function is in, either DEVELOPMENT or LIVE. When a function is in the DEVELOPMENT
stage, you can test the function with TestFunction, and update it with UpdateFunction. When a function is in the
LIVE stage, you can attach the function to a distribution's cache behavior, using the function's ARN.
CreatedTime:
type: string
format: date-time
description: The date and time when the function was created.
LastModifiedTime:
type: string
format: date-time
description: The date and time when the function was most recently updated.
required:
- FunctionARN
- LastModifiedTime
FunctionSizeLimitExceeded:
type: object
properties:
Message:
type: string
FunctionSummary:
type: object
properties:
Name:
type: string
description: The name of the CloudFront function.
Status:
type: string
description: The status of the CloudFront function.
FunctionConfig:
$ref: '#/components/schemas/FunctionConfig'
FunctionMetadata:
$ref: '#/components/schemas/FunctionMetadata'
required:
- Name
- FunctionConfig
- FunctionMetadata
GetFunctionRequest:
type: object
properties:
Name:
type: string
description: The name of the function whose code you are getting.
Stage:
type: string
enum:
- DEVELOPMENT
- LIVE
description: The function's stage, either DEVELOPMENT or LIVE.
required:
- Name
GetFunctionResult:
type: object
properties:
FunctionCode:
type: string
format: byte
description: The function code of a CloudFront function.
ETag:
type: string
description: The version identifier for the current version of the CloudFront function.
ContentType:
type: string
description: The content type (media type) of the response.
InvalidArgument:
type: object
properties:
Message:
type: string
InvalidIfMatchVersion:
type: object
properties:
Message:
type: string
KeyValueStoreAssociation:
type: object
properties:
KeyValueStoreARN:
type: string
description: The Amazon Resource Name (ARN) of the key value store association.
required:
- KeyValueStoreARN
KeyValueStoreAssociations:
type: object
properties:
Quantity:
type: integer
description: The quantity of key value store associations.
Items:
type: array
items:
$ref: '#/components/schemas/KeyValueStoreAssociation'
description: The items of the key value store association.
required:
- Quantity
ListFunctionsRequest:
type: object
properties:
Marker:
type: string
description: Use this field when paginating results to indicate where to begin in your list of functions. The response
includes functions 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 functions that you want in the response.
Stage:
type: string
enum:
- DEVELOPMENT
- LIVE
description: An optional filter to return only the functions that are in the specified stage, either DEVELOPMENT
or LIVE.
ListFunctionsResult:
type: object
properties:
FunctionList:
$ref: '#/components/schemas/FunctionList'
NoSuchFunctionExists:
type: object
properties:
Message:
type: string
PreconditionFailed:
type: object
properties:
Message:
type: string
PublishFunctionRequest:
type: object
properties:
Name:
type: string
description: The name of the function that you are publishing.
IfMatch:
type: string
description: The current version (ETag value) of the function that you are publishing, which you can get using DescribeFunction.
required:
- Name
- IfMatch
PublishFunctionResult:
type: object
properties:
FunctionSummary:
$ref: '#/components/schemas/FunctionSummary'
Tag:
type: object
properties:
Key:
type: string
description: 'A string that contains Tag key. The string length should be between 1 and 128 characters. Valid characters
include a-z, A-Z, 0-9, space, and the special characters _ - . : / = + @.'
Value:
type: string
description: 'A string that contains an optional Tag value. The string length should be between 0 and 256 characters.
Valid characters include a-z, A-Z, 0-9, space, and the special characters _ - . : / = + @.'
required:
- Key
Tags:
type: object
properties:
Items:
type: array
items:
$ref: '#/components/schemas/Tag'
description: A complex type that contains Tag elements.
TestFunctionFailed:
type: object
properties:
Message:
type: string
TestFunctionRequest:
type: object
properties:
Name:
type: string
description: The name of the function that you are testing.
IfMatch:
type: string
description: The current version (ETag value) of the function that you are testing, which you can get using DescribeFunction.
Stage:
type: string
enum:
- DEVELOPMENT
- LIVE
description: The stage of the function that you are testing, either DEVELOPMENT or LIVE.
EventObject:
type: string
format: byte
description: The event object to test the function with. For more information about the structure of the event object,
see Testing functions in the Amazon CloudFront Developer Guide.
required:
- Name
- IfMatch
- EventObject
TestFunctionResult:
type: object
properties:
TestResult:
$ref: '#/components/schemas/TestResult'
TestResult:
type: object
properties:
FunctionSummary:
$ref: '#/components/schemas/FunctionSummary'
ComputeUtilization:
type: string
description: The amount of time that the function took to run as a percentage of the maximum allowed time. For example,
a compute utilization of 35 means that the function completed in 35% of the maximum allowed time.
FunctionExecutionLogs:
type: array
items:
type: string
description: Contains the log lines that the function wrote (if any) when running the test.
FunctionErrorMessage:
type: string
description: If the result of testing the function was an error, this field contains the error message.
FunctionOutput:
type: string
description: The event object returned by the function. For more information about the structure of the event object,
see Event object structure in the Amazon CloudFront Developer Guide.
UnsupportedOperation:
type: object
properties:
Message:
type: string
UpdateFunctionRequest:
type: object
properties:
Name:
type: string
description: The name of the function that you are updating.
IfMatch:
type: string
description: The current version (ETag value) of the function that you are updating, which you can get using DescribeFunction.
FunctionConfig:
$ref: '#/components/schemas/FunctionConfig'
FunctionCode:
type: string
format: byte
description: The function code. For more information about writing a CloudFront function, see Writing function code
for CloudFront Functions in the Amazon CloudFront Developer Guide.
required:
- Name
- IfMatch
- FunctionConfig
- FunctionCode
UpdateFunctionResult:
type: object
properties:
FunctionSummary:
$ref: '#/components/schemas/FunctionSummary'
ETag:
type: string
description: The version identifier for the current version of the CloudFront function.
x-provenance:
method: harvested
publisher: Amazon Web Services
source: https://raw.githubusercontent.com/aws/api-models-aws/3cd98287b471c106254abd89279cc87308d38bfd/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)