API Reference

PREVIEW DOCUMENTATION - This is a preview of a new format for the AWS SDK for Go API Reference documentation. For the current AWS SDK for Go API Reference, see

We welcome your feedback on this new version of the documentation. Send your comments to


import ""

type ImportRestApiInput struct { Body []byte `locationName:"body" type:"blob" required:"true"` FailOnWarnings *bool `location:"querystring" locationName:"failonwarnings" type:"boolean"` Parameters map[string]*string `location:"querystring" locationName:"parameters" type:"map"` }

A POST request to import an API to API Gateway using an input of an API definition file.


Type: []byte

[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 2MB.

Body is a required field


Type: *bool

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


Type: map[string]*string

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.

To exclude DocumentationParts from the import, set parameters as ignore=documentation.

To configure the endpoint type, set parameters as endpointConfigurationTypes=EDGE, endpointConfigurationTypes=REGIONAL, or endpointConfigurationTypes=PRIVATE. The default endpoint type is EDGE.

To handle imported basePath, set parameters as basePath=ignore, basePath=prepend or basePath=split.

For example, the AWS CLI command to exclude documentation from the imported API is:

aws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'

The AWS CLI command to set the regional endpoint on the imported API is:

aws apigateway import-rest-api --parameters endpointConfigurationTypes=REGIONAL --body 'file:///path/to/imported-api-body.json'



func (s ImportRestApiInput) GoString() string

GoString returns the string representation


func (s *ImportRestApiInput) SetBody(v []byte) *ImportRestApiInput

SetBody sets the Body field's value.


func (s *ImportRestApiInput) SetFailOnWarnings(v bool) *ImportRestApiInput

SetFailOnWarnings sets the FailOnWarnings field's value.


func (s *ImportRestApiInput) SetParameters(v map[string]*string) *ImportRestApiInput

SetParameters sets the Parameters field's value.


func (s ImportRestApiInput) String() string

String returns the string representation


func (s *ImportRestApiInput) Validate() error

Validate inspects the fields of the type to determine if they are valid.

On this page: