#How to get the <sub>.workers.dev zone programmatically?

5 messages · Page 1 of 1 (latest)

crisp cairn
#

When setting up a worker and worker route via the dashboard, the route gets assigned to my <sub>.workers.dev zone automatically. For example, I go through the "Create an app"->"Create a worker"->"Deploy "Hello World" script"->Deploy flow and my route is available under diana-247.workers.dev .

I'd like to be able to find/retrieve this same zone via the API so when I create a worker/route it gets assigned to the same worker.dev but I can't seem to get this data. I queried the list zones but that only shows my own domains. Is this available elsewhere, if so where?

frozen steeple
#

I'd like to be able to find/retrieve this same zone via the API so when I create a worker/route it gets assigned to the same worker.dev but I can't seem to get this data
Can you clarify what you mean by this? You pick a workers.dev subdomain per account, and it stays yours forever

crisp cairn
#

Okay, so in other words, I want to retrieve my subdomain, diana-247.workers.dev, programmatically. Is there a way to do so via the API?

#

The reason being, I want to create a worker+route and have it assigned to my workers.dev similar to how it occuers when following the Dashboard steps