Add public host name to tunnel via API

I have been searching through the Cloudflare API to find an endpoint to add a public host to an existing tunnel. Is there such an endpoint? I want to automate adding public hosts to a tunnel. Thanks.

Perhaps this is what you’re looking for? Cloudflare API v4 Documentation

I would recommend avoiding the new API docs for now and use an older mirror - the code samples, search, authentication recommendations, etc. are not great, and in some cases actually harmful on the new ones. If you search the previous link I provided for “tunnel” in the top left, hopefully you can find what you need.

1 Like

Thanks for the link to the new documentation but I still can’t find it. I then realized that I was going about it wrong. The solution seems to be to create the DNS record directly and use the tunnel as the target (ie. 20557d52-bee6-48af-aa71-xxxxxxcfb.cfargotunnel.com). I will try this out a little later.

2 Likes