## Create Silences `client.Alerting.Silences.New(ctx, params) (*SilenceNewResponse, error)` **post** `/accounts/{account_id}/alerting/v3/silences` Creates a new silence for an account. ### Parameters - `params SilenceNewParams` - `AccountID param.Field[string]` Path param: The account id - `Body param.Field[[]SilenceNewParamsBody]` Body param - `EndTime string` When the silence ends. - `PolicyID string` The unique identifier of a notification policy - `StartTime string` When the silence starts. ### Returns - `type SilenceNewResponse struct{…}` - `Errors []SilenceNewResponseError` - `Message string` - `Code int64` - `Messages []SilenceNewResponseMessage` - `Message string` - `Code int64` - `Success SilenceNewResponseSuccess` Whether the API call was successful - `const SilenceNewResponseSuccessTrue SilenceNewResponseSuccess = true` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/alerting" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) silence, err := client.Alerting.Silences.New(context.TODO(), alerting.SilenceNewParams{ AccountID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"), Body: []alerting.SilenceNewParamsBody{alerting.SilenceNewParamsBody{ }}, }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", silence.Errors) } ``` #### Response ```json { "errors": [ { "message": "message", "code": 1000 } ], "messages": [ { "message": "message", "code": 1000 } ], "success": true } ```