
Trying Out Exploring REST APIs and Promoting Them to Managed APIs with the API Portal in Amazon API Gateway
This page has been translated by machine translation. View original
Introduction
On November 23, 2026, API Portal for Amazon API Gateway was released.
API Portal is a feature for discovering, managing, and documenting APIs and AI endpoints that run behind API Gateway, ALB, and CloudFront.
This article presents the results of trying everything from discovery to promotion to a managed API with the AWS CLI, using an API Gateway REST API.
Test environment
- Region: Tokyo (ap-northeast-1)
- aws-cli: 2.42.2
- REST API (public):
apiportal-verify-pub, REGIONAL, GET /v1/items and POST /v1/items - REST API (PRIVATE):
apiportal-verify-priv, GET /v1/internal - Stage: prod
- Integration: MOCK
- Authentication: none
Commands to create the REST APIs
Create the public API (REGIONAL) and the PRIVATE API with MOCK integrations, and deploy them to the prod stage. For the PRIVATE API, attach the resource policy before deploying. For this test, I saved a policy that allows execute-api:Invoke for all principals as private-api-policy.json.
{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":"*","Action":"execute-api:Invoke","Resource":"execute-api:/*"}]}
export AWS_REGION=ap-northeast-1
# Public API (REGIONAL)
aws apigateway create-rest-api \
--name apiportal-verify-pub --endpoint-configuration types=REGIONAL \
--query '{id:id,name:name,createdDate:createdDate}' --output json
PUB=$(aws apigateway get-rest-apis --query "items[?name=='apiportal-verify-pub'].id | [0]" --output text)
ROOT=$(aws apigateway get-resources --rest-api-id "$PUB" --query 'items[0].id' --output text)
V1=$(aws apigateway create-resource --rest-api-id "$PUB" --parent-id "$ROOT" --path-part v1 --query id --output text)
ITEMS=$(aws apigateway create-resource --rest-api-id "$PUB" --parent-id "$V1" --path-part items --query id --output text)
for M in GET POST; do
aws apigateway put-method --rest-api-id "$PUB" --resource-id "$ITEMS" \
--http-method $M --authorization-type NONE
aws apigateway put-integration --rest-api-id "$PUB" --resource-id "$ITEMS" \
--http-method $M --type MOCK --request-templates '{"application/json":"{\"statusCode\":200}"}'
aws apigateway put-method-response --rest-api-id "$PUB" --resource-id "$ITEMS" \
--http-method $M --status-code 200
aws apigateway put-integration-response --rest-api-id "$PUB" --resource-id "$ITEMS" \
--http-method $M --status-code 200 --response-templates '{"application/json":"{\"items\":[]}"}'
done
aws apigateway create-deployment --rest-api-id "$PUB" --stage-name prod \
--query '{id:id,createdDate:createdDate}' --output json
# PRIVATE API
aws apigateway create-rest-api \
--name apiportal-verify-priv --endpoint-configuration types=PRIVATE \
--query '{id:id,name:name,createdDate:createdDate}' --output json
PRV=$(aws apigateway get-rest-apis --query "items[?name=='apiportal-verify-priv'].id | [0]" --output text)
PROOT=$(aws apigateway get-resources --rest-api-id "$PRV" --query 'items[0].id' --output text)
PV1=$(aws apigateway create-resource --rest-api-id "$PRV" --parent-id "$PROOT" --path-part v1 --query id --output text)
INT=$(aws apigateway create-resource --rest-api-id "$PRV" --parent-id "$PV1" --path-part internal --query id --output text)
aws apigateway put-method --rest-api-id "$PRV" --resource-id "$INT" \
--http-method GET --authorization-type NONE
aws apigateway put-integration --rest-api-id "$PRV" --resource-id "$INT" \
--http-method GET --type MOCK --request-templates '{"application/json":"{\"statusCode\":200}"}'
aws apigateway put-method-response --rest-api-id "$PRV" --resource-id "$INT" \
--http-method GET --status-code 200
aws apigateway put-integration-response --rest-api-id "$PRV" --resource-id "$INT" \
--http-method GET --status-code 200 --response-templates '{"application/json":"{\"ok\":true}"}'
# Attach the resource policy, then deploy
PATCH=$(python3 -c 'import json,sys;print(json.dumps([{"op":"replace","path":"/policy","value":open("private-api-policy.json").read()}]))')
aws apigateway update-rest-api --rest-api-id "$PRV" --patch-operations "$PATCH" \
--query '{id:id,name:name}' --output json
aws apigateway create-deployment --rest-api-id "$PRV" --stage-name prod \
--query '{id:id,createdDate:createdDate}' --output json
Discovery configuration
The discovery configuration and the inventory are per region. You create the discovery configuration by choosing Enable discovery in API inventory in the console, or with the CLI. This time, I created it with the CLI's put-discovery-configuration, targeting only API Gateway.
aws apiportal put-discovery-configuration --discovery-sources API_GATEWAY --region ap-northeast-1 --output json
{
"discoveryConfiguration": {
"arn": "arn:aws:apiportal:ap-northeast-1:123456789012:discoveryconfiguration",
"status": "ENABLED",
"discoverySources": [
"API_GATEWAY"
],
"createdAt": "2026-11-25T22:31:49.458000+09:00",
"updatedAt": "2026-11-25T22:31:49.458000+09:00"
},
"tags": {}
}
You check the discovery status with list-discovery-statuses.
aws apiportal list-discovery-statuses --region ap-northeast-1
I checked at 10 to 15 second intervals for about 12 minutes right after creation, but the status remained STOPPED.
{
"items": [
{
"accountId": "123456789012",
"discoverySource": "API_GATEWAY",
"status": "STOPPED"
}
]
}
So I ran start-discovery, passing the ARN of the discovery configuration.
aws apiportal start-discovery --id arn:aws:apiportal:ap-northeast-1:123456789012:discoveryconfiguration --region ap-northeast-1
When I checked 11 seconds after running it, the status was RUNNING. The rest of the verification was done in this state.
Discovery
According to the developer guide, only REST APIs are targeted for discovery in API Gateway; HTTP APIs and WebSocket APIs are not discovered. Explicitly defined methods and fixed paths appear in the inventory from the API configuration, even without any requests. When the method is ANY or the path contains {proxy+}, they are not expanded from the configuration, and they appear in the inventory with the actual method and path at the point a request is received.
APIs behind ALB and CloudFront are discovered based on traffic, so endpoints that have not received requests do not appear. APIs behind CloudFront are discovered only in us-east-1.
Appearance in the inventory
I deployed the public API at 22:45:18 and the PRIVATE API at 22:45:24. After that, I ran the following command at 1-minute intervals to check whether the two APIs from this test appeared in the inventory. $PUB and $PRV are the REST API IDs obtained in the creation commands.
aws apiportal list-api-inventory-items --max-results 100 \
--query "items[?contains(resourceArn,'$PUB')||contains(resourceArn,'$PRV')||contains(host,'$PUB')||contains(host,'$PRV')]" \
--output json
In the first check at 22:45:36 and the second at 22:46:38, there were 0 items from this test's APIs, and 3 items appeared in the third check at 22:47:39. Since they appeared between the second and third checks, the time from deployment to appearance was within 2 minutes 21 seconds for the public API and within 2 minutes 15 seconds for the PRIVATE API.
According to the developer guide, new APIs usually appear within a few hours. If it is the first time enabling it in the account, it can take up to 24 hours. This time, they appeared within a few minutes. This is the result of a single run, deploying after the discovery configuration became RUNNING and checking at 1-minute intervals.
Inventory items
You can get the details of a single inventory item with get-api-inventory-item. This is the result of getting GET /prod/v1/items of the public API.
aws apiportal get-api-inventory-item --method GET --port 443 --path /prod/v1/items \
--host <pub-api-id>.execute-api.ap-northeast-1.amazonaws.com \
--resource-arn arn:aws:apigateway:ap-northeast-1::/restapis/<pub-api-id>/resources/<resource-id>/methods/GET\;arn:aws:apigateway:ap-northeast-1::/restapis/<pub-api-id>/stages/prod \
--output json
{
"item": {
"method": "GET",
"host": "<pub-api-id>.execute-api.ap-northeast-1.amazonaws.com",
"port": 443,
"path": "/prod/v1/items",
"accountId": "123456789012",
"resourceArn": "arn:aws:apigateway:ap-northeast-1::/restapis/<pub-api-id>/resources/<resource-id>/methods/GET;arn:aws:apigateway:ap-northeast-1::/restapis/<pub-api-id>/stages/prod",
"region": "ap-northeast-1",
"discoverySource": "API_GATEWAY",
"visibility": "PUBLIC",
"wafStatus": "DISABLED",
"classification": "SHADOW"
}
}
The 3 discovered items are as follows.
| method | path | visibility | classification | REST API endpoint type |
|---|---|---|---|---|
| GET | /prod/v1/items | PUBLIC | SHADOW | REGIONAL |
| POST | /prod/v1/items | PUBLIC | SHADOW | REGIONAL |
| GET | /prod/v1/internal | PRIVATE | SHADOW | PRIVATE |
The visibility values corresponded to the REST API endpoint types.
A classification of SHADOW indicates an API that has been discovered but not yet promoted to a managed API. According to the developer guide, one inventory item is a unit of method and path, and in API Gateway it is separated per deployed stage. With this execute-api host, the stage name was prefixed to the path (/prod/v1/items).
The response of get-api-inventory-item had the same 11 fields as the list. According to the developer guide, the console's details page shows the first and last detection times, but they were not included in the CLI response.
Managed APIs
Promotion
You promote a SHADOW API to a managed API with create-managed-api. For --api-signature, you pass the resourceArn, method, host, port, and path values of the inventory item as JSON. The key names are the same as in the inventory, except that host becomes hostname.
aws apiportal create-managed-api --api-signature '{"resourceArn": "arn:aws:apigateway:ap-northeast-1::/restapis/<pub-api-id>/resources/<resource-id>/methods/GET;arn:aws:apigateway:ap-northeast-1::/restapis/<pub-api-id>/stages/prod", "method": "GET", "hostname": "<pub-api-id>.execute-api.ap-northeast-1.amazonaws.com", "port": 443, "path": "/prod/v1/items"}' --output json
{
"managedApiId": "<managed-api-id>",
"managedApiArn": "arn:aws:apiportal:ap-northeast-1:123456789012:managedapis/<managed-api-id>",
"createdAt": "2026-11-25T22:48:34.596000+09:00",
"updatedAt": "2026-11-25T22:48:34.596000+09:00",
"tags": {}
}
The managedApiId in the response is used for later retrieval and deletion. I promoted the remaining 2 items with the same procedure.
This is the end of the response when I fetched the item again with get-api-inventory-item after promotion.
"classification": "MANAGED",
"managedBy": "SELF",
"managedApiId": "<managed-api-id>"
I compared the outputs of get-rest-apis, get-stage, and get-resources --embed methods before and after promotion. They matched for both the public API and the PRIVATE API, and the lastUpdatedDate of get-stage did not change either.
Security posture
Managed APIs are evaluated from perspectives such as authentication, WAF, and access logging. The evaluation result for each perspective is the security posture, which you get with get-managed-api.
aws apiportal get-managed-api --managed-api-id <managed-api-id> --output json
When I fetched it about 5 to 7 seconds after promotion, evaluation results for all 9 postures were returned for all 3 items. These are the first 2 of the findings included in the response for GET /prod/v1/items of the public API.
"findings": [
{
"postureId": "APIGW_API_KEY_REQUIRED",
"postureStatus": "FALSE",
"reason": "API_KEY_NOT_CONFIGURED",
"updatedAt": "2026-11-25T22:45:25.959000+09:00"
},
{
"postureId": "APIGW_METHOD_AUTHENTICATION_REQUIRED",
"postureStatus": "FALSE",
"reason": "AUTHENTICATION_NOT_CONFIGURED",
"updatedAt": "2026-11-25T22:45:25.925000+09:00"
},
...
postureStatus was one of TRUE, FALSE, or NOT_APPLICABLE. Since these are simple APIs with neither authentication nor WAF this time, most results were FALSE, and TRUE appeared in only one place, APIGW_PRIVATE_RESOURCE_POLICY of the PRIVATE API.
| Posture | GET /prod/v1/items (public) | POST /prod/v1/items (public) | GET /prod/v1/internal (PRIVATE) |
|---|---|---|---|
| APIGW_METHOD_AUTHENTICATION_REQUIRED | FALSE | FALSE | FALSE |
| APIGW_API_KEY_REQUIRED | FALSE | FALSE | FALSE |
| APIGW_REQUEST_VALIDATION_ENABLED | NOT_APPLICABLE | FALSE | NOT_APPLICABLE |
| APIGW_STAGE_THROTTLING_ENABLED | FALSE | FALSE | FALSE |
| APIGW_STAGE_CACHING | FALSE | NOT_APPLICABLE | FALSE |
| APIGW_STAGE_WAF_ENABLED | FALSE | FALSE | FALSE |
| APIGW_STAGE_ACCESS_LOGGING | FALSE | FALSE | FALSE |
| APIGW_PRIVATE_RESOURCE_POLICY | NOT_APPLICABLE | NOT_APPLICABLE | TRUE |
| APIGW_REST_API_TLS_1_2_MINIMUM | FALSE | FALSE | FALSE |
Deleting a managed API
To cancel a promotion, run delete-managed-api.
aws apiportal delete-managed-api --managed-api-id <managed-api-id>
When I deleted each of the 3 managed APIs, the classification in the inventory returned to SHADOW for all 3 items.
Inventory after deletion
When I deleted both REST APIs after the verification and fetched the inventory, the 3 items of the deleted REST APIs remained as SHADOW. According to the developer guide, items remain for about 30 days even after the API is deleted.
Summary
In API Portal in the Tokyo Region, I was able to confirm REST API discovery and promotion to managed APIs.
If many systems in your organization provide REST APIs and you have challenges with their management status, try managing your APIs with API Portal.



