## Detach Domain `client.Workers.Domains.Delete(ctx, domainID, body) (*DomainDeleteResponse, error)` **delete** `/accounts/{account_id}/workers/domains/{domain_id}` Detaches a domain from a Worker. Both the Worker and all of its previews are no longer routable using this domain. ### Parameters - `domainID string` ID of the domain. - `body DomainDeleteParams` - `AccountID param.Field[string]` Identifier. ### Returns - `type DomainDeleteResponse struct{…}` - `Errors []DomainDeleteResponseError` - `Code int64` - `Message string` - `DocumentationURL string` - `Source DomainDeleteResponseErrorsSource` - `Pointer string` - `Messages []DomainDeleteResponseMessage` - `Code int64` - `Message string` - `DocumentationURL string` - `Source DomainDeleteResponseMessagesSource` - `Pointer string` - `Success DomainDeleteResponseSuccess` Whether the API call was successful. - `const DomainDeleteResponseSuccessTrue DomainDeleteResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/workers" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) domain, err := client.Workers.Domains.Delete( context.TODO(), "dbe10b4bc17c295377eabd600e1787fd", workers.DomainDeleteParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", domain.Errors) } ``` #### 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" } } ], "success": true } ```