You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

能否在AWS API Gateway中删除API?学习创建的多API如何删除?

Can You Delete APIs in AWS API Gateway? (And How to Do It)

Absolutely! You can definitely delete APIs in AWS API Gateway—whether they're REST, HTTP, or WebSocket APIs. Below are step-by-step methods for both the AWS Management Console and AWS CLI, depending on your workflow preference.

Using the AWS Management Console

  • Log into your AWS account and navigate directly to the API Gateway service dashboard.
  • In the left sidebar, select the category matching the API type you want to delete (e.g., REST APIs, HTTP APIs, WebSocket APIs).
  • From the list of APIs displayed, click the name of the API you wish to remove to open its details page.
  • Locate the Actions dropdown menu in the top-right corner of the page.
  • Select Delete API from the dropdown options.
  • A confirmation dialog will appear—double-check you’ve selected the correct API (since deletion is irreversible), then click Delete to finalize the action.

Note: Before deleting, verify there are no active deployments, linked Lambda functions, or downstream dependencies that might break once the API is removed. Deleted APIs cannot be recovered.

Using the AWS CLI

If you prefer command-line operations, the AWS CLI offers straightforward commands to delete APIs. The exact command varies slightly based on the API type:

For REST APIs

Run this command, replacing your-api-id with the unique ID of your REST API:

aws apigateway delete-rest-api --rest-api-id your-api-id

For HTTP APIs

Use this command, substituting your-api-id with your HTTP API's ID:

aws apigatewayv2 delete-api --api-id your-api-id

For WebSocket APIs

WebSocket APIs use the same API Gateway V2 endpoint as HTTP APIs, so the command is identical:

aws apigatewayv2 delete-api --api-id your-api-id

Tip: To retrieve your API's ID, you can list all APIs of a specific type with commands like aws apigateway get-rest-apis (for REST APIs) or aws apigatewayv2 get-apis (for HTTP/WebSocket APIs).

内容的提问来源于stack exchange,提问作者Ramjan Ali

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.20 11:56:48