## Post Worker subdomain **post** `/accounts/{account_id}/workers/scripts/{script_name}/subdomain` Enable or disable the Worker on the workers.dev subdomain. ### Path Parameters - `account_id: string` Identifier. - `script_name: string` Name of the script, used in URLs and route configuration. ### Body Parameters - `enabled: boolean` Whether the Worker should be available on the workers.dev subdomain. - `previews_enabled: optional boolean` Whether the Worker's Preview URLs should be available on the workers.dev subdomain. ### Returns - `errors: array of object { code, message, documentation_url, source }` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `messages: array of object { code, message, documentation_url, source }` - `code: number` - `message: string` - `documentation_url: optional string` - `source: optional object { pointer }` - `pointer: optional string` - `result: object { enabled, previews_enabled }` - `enabled: boolean` Whether the Worker is available on the workers.dev subdomain. - `previews_enabled: boolean` Whether the Worker's Preview URLs are available on the workers.dev subdomain. - `success: true` Whether the API call was successful. - `true` ### Example ```http curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/workers/scripts/$SCRIPT_NAME/subdomain \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ -d '{ "enabled": true }' ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "result": { "enabled": false, "previews_enabled": false }, "success": true } ```