Skip to main content

rest_apis

Creates, updates, deletes, gets or lists a rest_apis resource.

Overview

Namerest_apis
TypeResource
Idaws.apigateway.rest_apis

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringThe API's identifier. This identifier is unique across all of your APIs in API Gateway.
namestringThe API's name.
api_key_sourcestringThe source of the API key for metering requests according to a usage plan. Valid values are: >HEADER to read the API key from the X-API-Key header of a request. AUTHORIZER to read the API key from the UsageIdentifierKey from a custom authorizer. (HEADER, AUTHORIZER)
api_statusstringThe ApiStatus of the RestApi. (UPDATING, AVAILABLE, PENDING, FAILED)
api_status_messagestringThe status message of the RestApi. When the status message is UPDATING you can still invoke it.
binary_media_typesarrayThe list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.
created_datestring (date-time)The timestamp when the API was created.
descriptionstringThe API's description.
disable_execute_api_endpointbooleanSpecifies whether clients can invoke your API by using the default execute-api endpoint. By default, clients can invoke your API with the default https:​//{api_id}.execute-api.{region}.amazonaws.com endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint.
endpoint_access_modestringThe endpoint access mode of the RestApi. (BASIC, STRICT)
endpoint_configurationobjectThe endpoint configuration to indicate the types of endpoints an API (RestApi) or its custom domain name (DomainName) has and the IP address types that can invoke it.
minimum_compression_sizeintegerA 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.
policystringA stringified JSON policy document that applies to this RestApi regardless of the caller and Method configuration.
root_resource_idstringThe API's root resource ID.
security_policystringThe Transport Layer Security (TLS) version + cipher suite for this RestApi. (TLS_1_0, TLS_1_2, SecurityPolicy_TLS13_1_3_2025_09, SecurityPolicy_TLS13_1_3_FIPS_2025_09, SecurityPolicy_TLS13_1_2_PFS_PQ_2025_09, SecurityPolicy_TLS13_1_2_FIPS_PQ_2025_09, SecurityPolicy_TLS13_1_2_FIPS_PFS_PQ_2025_09, SecurityPolicy_TLS13_1_2_PQ_2025_09, SecurityPolicy_TLS13_1_2_2021_06, SecurityPolicy_TLS13_2025_EDGE, SecurityPolicy_TLS12_PFS_2025_EDGE, SecurityPolicy_TLS12_2018_EDGE)
tagsobjectThe collection of tags. Each tag element is associated with a given resource.
versionstringA version identifier for the API.
warningsarrayThe warning messages reported when failonwarnings is turned on during API import.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_rest_apiselectrestapi_id, regionLists the RestApi resource in the collection.
get_rest_apisselectregionposition, limitLists the RestApis resources for your collection.
create_rest_apiinsertregion, nameCreates a new RestApi resource.
update_rest_apiupdaterestapi_id, regionChanges information about the specified API.
put_rest_apireplacerestapi_id, region, bodymode, failonwarnings, parametersA feature of the API Gateway control service for updating an existing API with an input of external API definitions. The update can take the form of merging the supplied definition into the existing API or overwriting the existing API.
delete_rest_apideleterestapi_id, regionDeletes the specified API.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)
restapi_idstringThe string identifier of the associated RestApi.
failonwarningsbooleanA query parameter to indicate whether to rollback the API update (true) or not (false) when a warning is encountered. The default value is false.
limitintegerThe maximum number of returned results per page. The default value is 25 and the maximum value is 500.
modestringThe mode query parameter to specify the update mode. Valid values are "merge" and "overwrite". By default, the update mode is "merge".
parametersobjectCustom header parameters as part of the request. For example, to exclude DocumentationParts from an imported API, set ignore=documentation as a parameters value, as in the AWS CLI command of aws apigateway import-rest-api --parameters ignore=documentation --body 'file:​///path/to/imported-api-body.json'.
positionstringThe current pagination position in the paged result set.

SELECT examples

Lists the RestApi resource in the collection.

SELECT
id,
name,
api_key_source,
api_status,
api_status_message,
binary_media_types,
created_date,
description,
disable_execute_api_endpoint,
endpoint_access_mode,
endpoint_configuration,
minimum_compression_size,
policy,
root_resource_id,
security_policy,
tags,
version,
warnings
FROM aws.apigateway.rest_apis
WHERE restapi_id = '{{ restapi_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a new RestApi resource.

INSERT INTO aws.apigateway.rest_apis (
name,
description,
version,
cloneFrom,
binaryMediaTypes,
minimumCompressionSize,
apiKeySource,
endpointConfiguration,
policy,
tags,
disableExecuteApiEndpoint,
securityPolicy,
endpointAccessMode,
region
)
SELECT
'{{ name }}' /* required */,
'{{ description }}',
'{{ version }}',
'{{ cloneFrom }}',
'{{ binaryMediaTypes }}',
{{ minimumCompressionSize }},
'{{ apiKeySource }}',
'{{ endpointConfiguration }}',
'{{ policy }}',
'{{ tags }}',
{{ disableExecuteApiEndpoint }},
'{{ securityPolicy }}',
'{{ endpointAccessMode }}',
'{{ region }}'
RETURNING
id,
name,
api_key_source,
api_status,
api_status_message,
binary_media_types,
created_date,
description,
disable_execute_api_endpoint,
endpoint_access_mode,
endpoint_configuration,
minimum_compression_size,
policy,
root_resource_id,
security_policy,
tags,
version,
warnings
;

UPDATE examples

Changes information about the specified API.

UPDATE aws.apigateway.rest_apis
SET
patchOperations = '{{ patchOperations }}'
WHERE
restapi_id = '{{ restapi_id }}' --required
AND region = '{{ region }}' --required
RETURNING
id,
name,
api_key_source,
api_status,
api_status_message,
binary_media_types,
created_date,
description,
disable_execute_api_endpoint,
endpoint_access_mode,
endpoint_configuration,
minimum_compression_size,
policy,
root_resource_id,
security_policy,
tags,
version,
warnings;

REPLACE examples

A feature of the API Gateway control service for updating an existing API with an input of external API definitions. The update can take the form of merging the supplied definition into the existing API or overwriting the existing API.

REPLACE aws.apigateway.rest_apis
SET
body = '{{ body }}'
WHERE
restapi_id = '{{ restapi_id }}' --required
AND region = '{{ region }}' --required
AND body = '{{ body }}' --required
AND mode = '{{ mode}}'
AND failonwarnings = {{ failonwarnings}}
AND parameters = '{{ parameters}}'
RETURNING
id,
name,
api_key_source,
api_status,
api_status_message,
binary_media_types,
created_date,
description,
disable_execute_api_endpoint,
endpoint_access_mode,
endpoint_configuration,
minimum_compression_size,
policy,
root_resource_id,
security_policy,
tags,
version,
warnings;

DELETE examples

Deletes the specified API.

DELETE FROM aws.apigateway.rest_apis
WHERE restapi_id = '{{ restapi_id }}' --required
AND region = '{{ region }}' --required
;