Skip to content
Start here

Domains

List Worker Domains
client.workers.domains.list(DomainListParams { account_id, enabled, environment, 5 more } params, RequestOptionsoptions?): SinglePage<DomainListResponse { id, cert_id, enabled, 6 more } >
GET/accounts/{account_id}/workers/domains
Get Worker Domain
client.workers.domains.get(stringdomainID, DomainGetParams { account_id } params, RequestOptionsoptions?): DomainGetResponse { id, cert_id, enabled, 6 more }
GET/accounts/{account_id}/workers/domains/{domain_id}
Attach Worker Domain
client.workers.domains.update(DomainUpdateParams { account_id, hostname, service, 4 more } params, RequestOptionsoptions?): DomainUpdateResponse { id, cert_id, enabled, 6 more }
PUT/accounts/{account_id}/workers/domains
Detach Worker Domain
client.workers.domains.delete(stringdomainID, DomainDeleteParams { account_id } params, RequestOptionsoptions?): DomainDeleteResponse { errors, messages, success }
DELETE/accounts/{account_id}/workers/domains/{domain_id}
ModelsExpand Collapse
DomainListResponse { id, cert_id, enabled, 6 more }
id: string

Immutable ID of the domain.

cert_id: string

ID of the TLS certificate issued for the domain.

formatuuid
enabled: boolean

Whether the configured hostname is routable for the domain. If disabled, then requests to the configured hostname will not be routed to the configured Worker. If disabled, then preview routing must be enabled, and only subdomains of the configured hostname will be routable.

Deprecatedenvironment: string

Worker environment associated with the domain.

hostname: string

Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.

previews_enabled: boolean

Whether previews are routable for the domain. If enabled, previews will be routable as subdomains of the configured hostname. For example, if the configured hostname is app.example.com, then requests to my-feature.app.example.com will be routed to the preview with slug my-feature, if such a preview exists. If preview routing is disabled, then hostname routing must be enabled.

service: string

Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.

zone_id: string

ID of the zone containing the domain hostname.

zone_name: string

Name of the zone containing the domain hostname.

DomainGetResponse { id, cert_id, enabled, 6 more }
id: string

Immutable ID of the domain.

cert_id: string

ID of the TLS certificate issued for the domain.

formatuuid
enabled: boolean

Whether the configured hostname is routable for the domain. If disabled, then requests to the configured hostname will not be routed to the configured Worker. If disabled, then preview routing must be enabled, and only subdomains of the configured hostname will be routable.

Deprecatedenvironment: string

Worker environment associated with the domain.

hostname: string

Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.

previews_enabled: boolean

Whether previews are routable for the domain. If enabled, previews will be routable as subdomains of the configured hostname. For example, if the configured hostname is app.example.com, then requests to my-feature.app.example.com will be routed to the preview with slug my-feature, if such a preview exists. If preview routing is disabled, then hostname routing must be enabled.

service: string

Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.

zone_id: string

ID of the zone containing the domain hostname.

zone_name: string

Name of the zone containing the domain hostname.

DomainUpdateResponse { id, cert_id, enabled, 6 more }
id: string

Immutable ID of the domain.

cert_id: string

ID of the TLS certificate issued for the domain.

formatuuid
enabled: boolean

Whether the configured hostname is routable for the domain. If disabled, then requests to the configured hostname will not be routed to the configured Worker. If disabled, then preview routing must be enabled, and only subdomains of the configured hostname will be routable.

Deprecatedenvironment: string

Worker environment associated with the domain.

hostname: string

Hostname of the domain. Can be either the zone apex or a subdomain of the zone. Requests to this hostname will be routed to the configured Worker.

previews_enabled: boolean

Whether previews are routable for the domain. If enabled, previews will be routable as subdomains of the configured hostname. For example, if the configured hostname is app.example.com, then requests to my-feature.app.example.com will be routed to the preview with slug my-feature, if such a preview exists. If preview routing is disabled, then hostname routing must be enabled.

service: string

Name of the Worker associated with the domain. Requests to the configured hostname will be routed to this Worker.

zone_id: string

ID of the zone containing the domain hostname.

zone_name: string

Name of the zone containing the domain hostname.

DomainDeleteResponse { errors, messages, success }
errors: Array<Error>
code: number
minimum1000
message: string
documentation_url?: string
source?: Source { pointer }
pointer?: string
messages: Array<Message>
code: number
minimum1000
message: string
documentation_url?: string
source?: Source { pointer }
pointer?: string
success: true

Whether the API call was successful.