I want to allow clients to invoke my Amazon API Gateway APIs with only the custom domain name.
Resolution
To deactivate the default endpoint, use the API Gateway console, AWS Command Line Interface (AWS CLI), or AWS CloudFormation. After you deactivate the default endpoint, you must update a stage for the update to take effect. For example, create a deployment and attach it to a stage.
Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.
API Gateway console
For REST APIs, see the AWS Management Console tab in Disable the default endpoint for REST APIs. For HTTP APIs, see the AWS Management Console tab in Disable the default endpoint for HTTP APIs.
AWS CLI
For REST APIs, see the AWS CLI tab in Disable the default endpoint for REST APIs. For HTTP APIs, see the AWS CLI tab in Disable the default endpoint for HTTP APIs.
CloudFormation
Update the CloudFormation template for your REST API or HTTP API to set the DisableExecuteApiEndpoint parameter to True.
Important: If you use the default endpoint URL to invoke the API, then you receive an error when you deactivate the default endpoint. You receive an HTTP "403 Forbidden" error for REST APIs or an HTTP "404 Not Found" error for HTTP APIs.
Related information
Invoke REST APIs in API Gateway
How do I troubleshoot HTTP 403 errors from API Gateway?