Enable workers.dev route for worker deployed via API

I'm using the API here to deploy a worker via the API:
https://developers.cloudflare.com/api/operations/worker-script-upload-worker-module

However, after the worker has been deployed, it will not be accesible at its ...workers.dev url. I can enable it in the dash, but I want to enable it also via the API. I can't find the right API call to do this. With a bit of haxxing, googling, and intercepting traffic from the dash, I have come up the following, which actually works, but I can't find any info about it:
https://api.cloudflare.com/client/v4/accounts/...account_id.../workers/services/...script_name.../environments/production/subdomain

But I can't find any docs about this. Also, there is about a minute delay before the page appears, so I'm thinking this is not how it is supposed to be done. How should it be done?
Interact with Cloudflare's products and services via the Cloudflare API
Was this page helpful?