v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-14120262383.5 KB

A feature of the API Gateway control service for creating a new API from an external API definition file.

post/restapis#mode=import

Query parameters

failonwarningsboolean

A query parameter to indicate whether to rollback the API creation (<code>true</code>) or not (<code>false</code>) when a warning is encountered. The default value is <code>false</code>.

parametersobject
<p>A key-value map of context-specific query string parameters specifying the behavior of different API importing operations. The following shows operation-specific parameters and their supported values.</p> <p> To exclude DocumentationParts from the import, set <code>parameters</code> as <code>ignore=documentation</code>.</p> <p> To configure the endpoint type, set <code>parameters</code> as <code>endpointConfigurationTypes=EDGE</code>, <code>endpointConfigurationTypes=REGIONAL</code>, or <code>endpointConfigurationTypes=PRIVATE</code>. The default endpoint type is <code>EDGE</code>.</p> <p> To handle imported <code>basepath</code>, set <code>parameters</code> as <code>basepath=ignore</code>, <code>basepath=prepend</code> or <code>basepath=split</code>.</p> <p>For example, the AWS CLI command to exclude documentation from the imported API is:</p> <p>The AWS CLI command to set the regional endpoint on the imported API is:</p>
mode'import' required

Request body

bodystring required

The POST request body containing external API definitions. Currently, only OpenAPI definition JSON/YAML files are supported. The maximum size of the API definition file is 6MB.

Response

Success

idstring

The API's identifier. This identifier is unique across all of your APIs in API Gateway.

namestring

The API's name.

descriptionstring

The API's description.

createdDatestring date-time

The timestamp when the API was created.

versionstring

A version identifier for the API.

warningsString[]

The warning messages reported when <code>failonwarnings</code> is turned on during API import.

binaryMediaTypesString[]

The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.

minimumCompressionSizeinteger

A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.

apiKeySource'HEADER' | 'AUTHORIZER'

The source of the API key for metering requests according to a usage plan. Valid values are: ><code>HEADER</code> to read the API key from the <code>X-API-Key</code> header of a request. <code>AUTHORIZER</code> to read the API key from the <code>UsageIdentifierKey</code> from a custom authorizer.

policystring

A stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.

tagsobject

The collection of tags. Each tag element is associated with a given resource.

disableExecuteApiEndpointboolean

Specifies whether clients can invoke your API by using the default <code>execute-api</code> endpoint. By default, clients can invoke your API with the default <code>https://{api_id}.execute-api.{region}.amazonaws.com</code> endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.