# ResponseType

Supported types of gateway responses.

- Source: [`aws-apigateway/lib/gateway-response.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-apigateway/lib/gateway-response.ts#L132)

## Example

```ts
const api = new apigateway.RestApi(this, 'books-api');
api.addGatewayResponse('test-response', {
  type: apigateway.ResponseType.ACCESS_DENIED,
  statusCode: '500',
  responseHeaders: {
    // Note that values must be enclosed within a pair of single quotes
    'Access-Control-Allow-Origin': "'test.com'",
    'test-key': "'test-value'",
  },
  templates: {
    'application/json': '{ "message": $context.error.messageString, "statusCode": "488", "type": "$context.error.responseType" }'
  }
});
```

## Properties

- `ACCESS_DENIED`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response for authorization failure.

- `API_CONFIGURATION_ERROR`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response for an invalid API configuration.

- `AUTHORIZER_CONFIGURATION_ERROR`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response for failing to connect to a custom or Amazon Cognito authorizer.

- `AUTHORIZER_FAILURE`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response when a custom or Amazon Cognito authorizer failed to authenticate the caller.

- `BAD_REQUEST_BODY`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response when the request body cannot be validated according to an enabled request validator.

- `BAD_REQUEST_PARAMETERS`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response when the request parameter cannot be validated according to an enabled request validator.

- `DEFAULT_4XX`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The default gateway response for an unspecified response type with the status code of 4XX.

- `DEFAULT_5XX`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The default gateway response for an unspecified response type with a status code of 5XX.

- `EXPIRED_TOKEN`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response for an AWS authentication token expired error.

- `INTEGRATION_FAILURE`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response for an integration failed error.

- `INTEGRATION_TIMEOUT`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response for an integration timed out error.

- `INVALID_API_KEY`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response for an invalid API key submitted for a method requiring an API key.

- `INVALID_SIGNATURE`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response for an invalid AWS signature error.

- `MISSING_AUTHENTICATION_TOKEN`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response for a missing authentication token error, including the cases when the client attempts to invoke an unsupported API method or resource.

- `QUOTA_EXCEEDED`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response for the usage plan quota exceeded error.

- `REQUEST_TOO_LARGE`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response for the request too large error.

- `RESOURCE_NOT_FOUND`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response when API Gateway cannot find the specified resource after an API request passes authentication and authorization.

- `responseType`: string — Valid value of response type.

- `THROTTLED`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response when usage plan, method, stage, or account level throttling limits exceeded.

- `UNAUTHORIZED`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response when the custom or Amazon Cognito authorizer failed to authenticate the caller.

- `UNSUPPORTED_MEDIA_TYPE`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response when a payload is of an unsupported media type, if strict passthrough behavior is enabled.

- `WAF_FILTERED`: [ResponseType](/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.ResponseType.html) (static) — The gateway response when a request is blocked by AWS WAF.

## Methods

- `of(type: string): ResponseType // chainable` (static) — A custom response type to support future cases.
