Use ngrok to tunnel to local API Gateway instance

I have a LocalStack instance running locally where I have an API Gateway serving a couple of endpoints. I am able to send API requests to this instance locally, and my Lambda functions respond to these requests.

My API Gateway URL looks like the following:
https://localapi.execute-api.localhost.localstack.cloud:4566

I have an endpoint I’d like to call:
POST https://localapi.execute-api.localhost.localstack.cloud:4566/local/test

I’d like to have an external webhook service call this endpoint to send data to it. This external service, of course, cannot resolve this URL, so I’d like to have a service like ngrok proxy requests to this endpoint.

ngrok http https://localapi.execute-api.localhost.localstack.cloud:4566

This sets up the proxy without issue:

Forwarding https://****.ngrok-free.app -> https://localapi.execute-api.localhost.localstack.cloud:4566

Ideally, I should be able to call POST https://****.ngrok-free.app/local/test and it should forward the request to my API Gateway. However, this is not the case. Ngrok will return a 200 OK response, but the request never hit my endpoint. In fact, I could put any URL following the base URL and it always returns a 200 OK on a POST request. If I turn my POST request to a GET request, however, I do get an error:

curl https://****.ngrok-free.app/local/test

<?xml version='1.0' encoding='utf-8'?>
<Error><Code>NoSuchBucket</Code><Message>The specified bucket does not exist</Message><RequestId>946b5360-b0a2-4ce3-915e-12e9f1b25c43</RequestId><BucketName>local</BucketName></Error>% 

Any advice how I can use ngrok to tunnel requests to my LocalStack API endpoints?

I was able to figure out how to do this.

Following the LocalStack API Gateway docs there is an alternative URL format that you can use to access your API Gateway.

In my case, the alternative format was POST http://localhost:4566/restapis/localapi/local/_user_request_/test.

Then, I could use ngrok http http://localhost:4566 and forward my request via POST https://****.ngrok-free.app/restapis/localapi/local/_user_request_/test