Amazon API Gateway
API Reference

Integration

Represents an API integration.

URI

/v2/apis/apiId/integrations/integrationId

HTTP Methods

GET

Operation ID: GetIntegration

Gets an Integration.

Path Parameters

Name Type Required Description
apiId String True

The API identifier.

integrationId String True

The integration ID.

Responses

Status Code Response Model Description
200 Integration

Success

404 NotFoundException

The resource specified in the request was not found.

429 LimitExceededException

The client is sending more than the allowed number of requests per unit of time.

See Also

DELETE

Operation ID: DeleteIntegration

Deletes an Integration.

Path Parameters

Name Type Required Description
apiId String True

The API identifier.

integrationId String True

The integration ID.

Responses

Status Code Response Model Description
204 None

The request has succeeded, and there is no additional content to send in the response payload body.

404 NotFoundException

The resource specified in the request was not found.

429 LimitExceededException

The client is sending more than the allowed number of requests per unit of time.

See Also

PATCH

Operation ID: UpdateIntegration

Updates an Integration.

Path Parameters

Name Type Required Description
apiId String True

The API identifier.

integrationId String True

The integration ID.

Responses

Status Code Response Model Description
200 Integration

Success

400 BadRequestException

One of the parameters in the request is invalid.

404 NotFoundException

The resource specified in the request was not found.

409 ConflictException

The resource already exists.

429 LimitExceededException

The client is sending more than the allowed number of requests per unit of time.

See Also

Schemas

Request Bodies

Example PATCH

{ "description": "string", "integrationType": enum, "integrationMethod": "string", "integrationUri": "string", "credentialsArn": "string", "connectionType": enum, "connectionId": "string", "requestParameters": { }, "requestTemplates": { }, "templateSelectionExpression": "string", "passthroughBehavior": enum, "contentHandlingStrategy": enum, "timeoutInMillis": integer }

Response Bodies

Example Integration

{ "integrationId": "string", "description": "string", "integrationType": enum, "integrationMethod": "string", "integrationUri": "string", "credentialsArn": "string", "connectionType": enum, "connectionId": "string", "requestParameters": { }, "requestTemplates": { }, "templateSelectionExpression": "string", "passthroughBehavior": enum, "contentHandlingStrategy": enum, "timeoutInMillis": integer, "integrationResponseSelectionExpression": "string" }

Example BadRequestException

{ "message": "string" }

Example NotFoundException

{ "message": "string", "resourceType": "string" }

Example ConflictException

{ "message": "string" }

Example LimitExceededException

{ "message": "string", "limitType": "string" }

Properties

BadRequestException

The request is not valid, for example, the input is incomplete or incorrect. See the accompanying error message for details.

Property Type Required Description
message

string

False

Describes the error encountered.

See Also

ConflictException

The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. See the accompanying error message for details.

Property Type Required Description
message

string

False

Describes the error encountered.

See Also

ConnectionType (enum)

Represents a connection type.

  • INTERNET

  • VPC_LINK

ContentHandlingStrategy (enum)

Specifies how to handle response payload content type conversions.

  • CONVERT_TO_BINARY

  • CONVERT_TO_TEXT

Integration

Represents an integration.

Property Type Required Description
integrationId

string

False

Represents the identifier of an integration.

description

string

False

Represents the description of an integration.

integrationType

IntegrationType

False

The integration type of an integration. One of the following:

AWS: for integrating the route or method request with an AWS service action, including the Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom integration. With any other AWS service action, this is known as AWS integration.

AWS_PROXY: for integrating the route or method request with the Lambda function-invoking action with the client request passed through as-is. This integration is also referred to as Lambda proxy integration.

HTTP: for integrating the route or method request with an HTTP endpoint. This integration is also referred to as the HTTP custom integration.

HTTP_PROXY: for integrating route or method request with an HTTP endpoint, with the client request passed through as-is. This is also referred to as HTTP proxy integration.

MOCK: for integrating the route or method request with API Gateway as a "loopback" endpoint without invoking any backend.

integrationMethod

string

False

Specifies the integration's HTTP method type.

integrationUri

string

False

For a Lambda proxy integration, this is the URI of the Lambda function.

credentialsArn

string

False

Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::*:user/*. To use resource-based permissions on supported AWS services, specify null.

connectionType

ConnectionType

False

The type of the network connection to the integration endpoint. Currently the only valid value is INTERNET, for connections through the public routable internet.

connectionId

string

False

The connection ID.

requestParameters

IntegrationParameters

False

A key-value map specifying request parameters that are passed from the method request to the backend. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the backend. The method request parameter value must match the pattern of method.request.{location}.{name} , where {location} is querystring, path, or header; and {name} must be a valid and unique method request parameter name.

requestTemplates

TemplateMap

False

Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.

templateSelectionExpression

string

False

The template selection expression for the integration.

passthroughBehavior

PassthroughBehavior

False

Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the requestTemplates property on the Integration resource. There are three valid values: WHEN_NO_MATCH, WHEN_NO_TEMPLATES, and NEVER.

WHEN_NO_MATCH passes the request body for unmapped content types through to the integration backend without transformation.

NEVER rejects unmapped content types with an HTTP 415 Unsupported Media Type response.

WHEN_NO_TEMPLATES allows pass-through when the integration has no content types mapped to templates. However, if there is at least one content type defined, unmapped content types will be rejected with the same HTTP 415 Unsupported Media Type response.

contentHandlingStrategy

ContentHandlingStrategy

False

Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following behaviors:

CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary blob.

CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string.

If this property is not defined, the response payload will be passed through from the integration response to the route response or method response without modification.

timeoutInMillis

integer

False

Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.

integrationResponseSelectionExpression

string

False

The integration response selection expression for the integration. See Integration Response Selection Expressions.

See Also

IntegrationParameters

A key-value map specifying response parameters that are passed to the method response from the backend. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}, where name is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name} or integration.response.body.{JSON-expression}, where name is a valid and unique response header name and JSON-expression is a valid JSON expression without the $ prefix.

Property Type Required Description

additionalProperties

string

False

See Also

IntegrationType (enum)

Represents an API method integration type.

  • AWS

  • HTTP

  • MOCK

  • HTTP_PROXY

  • AWS_PROXY

LimitExceededException

A limit has been exceeded. See the accompanying error message for details.

Property Type Required Description
message

string

False

Describes the error encountered.

limitType

string

False

The limit type.

See Also

NotFoundException

The resource specified in the request was not found. See the message field for more information.

Property Type Required Description
message

string

False

Describes the error encountered.

resourceType

string

False

The resource type.

See Also

PassthroughBehavior (enum)

Represents passthrough behavior for an integration response.

  • WHEN_NO_MATCH

  • NEVER

  • WHEN_NO_TEMPLATES

TemplateMap

A mapping of identifier keys to templates. The value is an actual template script. The key is typically a SelectionKey which is chosen based on evaluating a selection expression.

Property Type Required Description

additionalProperties

string

False

See Also

UpdateIntegrationInput

Represents the input parameters for an UpdateIntegration request.

Property Type Required Description
description

string

False

The description of the integration

integrationType

IntegrationType

False

The integration type of an integration. One of the following:

AWS: for integrating the route or method request with an AWS service action, including the Lambda function-invoking action. With the Lambda function-invoking action, this is referred to as the Lambda custom integration. With any other AWS service action, this is known as AWS integration.

AWS_PROXY: for integrating the route or method request with the Lambda function-invoking action with the client request passed through as-is. This integration is also referred to as Lambda proxy integration.

HTTP: for integrating the route or method request with an HTTP endpoint. This integration is also referred to as the HTTP custom integration.

HTTP_PROXY: for integrating route or method request with an HTTP endpoint, with the client request passed through as-is. This is also referred to as HTTP proxy integration.

MOCK: for integrating the route or method request with API Gateway as a "loopback" endpoint without invoking any backend.

integrationMethod

string

False

Specifies the integration's HTTP method type.

integrationUri

string

False

For a Lambda proxy integration, this is the URI of the Lambda function.

credentialsArn

string

False

Specifies the credentials required for the integration, if any. For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string arn:aws:iam::*:user/*. To use resource-based permissions on supported AWS services, specify null.

connectionType

ConnectionType

False

The type of the network connection to the integration endpoint. Currently the only valid value is INTERNET, for connections through the public routable internet.

connectionId

string

False

The connection ID.

requestParameters

IntegrationParameters

False

A key-value map specifying request parameters that are passed from the method request to the backend. The key is an integration request parameter name and the associated value is a method request parameter value or static value that must be enclosed within single quotes and pre-encoded as required by the backend. The method request parameter value must match the pattern of method.request.{location}.{name} , where {location} is querystring, path, or header; and {name} must be a valid and unique method request parameter name.

requestTemplates

TemplateMap

False

Represents a map of Velocity templates that are applied on the request payload based on the value of the Content-Type header sent by the client. The content type value is the key in this map, and the template (as a String) is the value.

templateSelectionExpression

string

False

The template selection expression for the integration.

passthroughBehavior

PassthroughBehavior

False

Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the requestTemplates property on the Integration resource. There are three valid values: WHEN_NO_MATCH, WHEN_NO_TEMPLATES, and NEVER.

WHEN_NO_MATCH passes the request body for unmapped content types through to the integration backend without transformation.

NEVER rejects unmapped content types with an HTTP 415 Unsupported Media Type response.

WHEN_NO_TEMPLATES allows pass-through when the integration has no content types mapped to templates. However, if there is at least one content type defined, unmapped content types will be rejected with the same HTTP 415 Unsupported Media Type response.

contentHandlingStrategy

ContentHandlingStrategy

False

Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following behaviors:

CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary blob.

CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string.

If this property is not defined, the response payload will be passed through from the integration response to the route response or method response without modification.

timeoutInMillis

integer

False

Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 milliseconds or 29 seconds.

See Also