## DeleteTask `client.Environments.Automations.Tasks.Delete(ctx, body) (*EnvironmentAutomationTaskDeleteResponse, error)` **post** `/gitpod.v1.EnvironmentAutomationService/DeleteTask` Deletes an automation task. Use this method to: - Remove unused tasks - Clean up task configurations - Delete obsolete automations ### Examples - Delete task: Removes a task and its configuration. ```yaml id: "d2c94c27-3b76-4a42-b88c-95a85e392c68" ``` ### Parameters - `body EnvironmentAutomationTaskDeleteParams` - `ID param.Field[string]` ### Returns - `type EnvironmentAutomationTaskDeleteResponse interface{…}` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) task, err := client.Environments.Automations.Tasks.Delete(context.TODO(), gitpod.EnvironmentAutomationTaskDeleteParams{ ID: gitpod.F("d2c94c27-3b76-4a42-b88c-95a85e392c68"), }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", task) } ``` #### Response ```json {} ```