---
title: esc env webhook new | CLI commands
url: /docs/esc/cli/commands/esc_env_webhook_new/
---

Create a new environment webhook.

## Synopsis

[EXPERIMENTAL] Create a new environment webhook

This command attaches a new webhook to the given environment. The positional
argument is the human-readable display name; the service generates the webhook's
unique name, which is printed on success and is the identifier used by the other
`esc env webhook` subcommands (edit, get, rm, ping, delivery list).

The webhook will be delivered to --url whenever the environment changes. Use
--event to limit the set of events that trigger a delivery, or --group to
subscribe to every event in a named group (valid groups for environment
webhooks: environments, change_requests). Both flags are repeatable. Event
and group names are validated by the service.

Allowed --format values are: raw (default), slack, ms_teams, pulumi_deployments.

URL requirements depend on --format:
  raw, ms_teams:      any http(s) URL
  slack:              must begin with https://hooks.slack.com/
  pulumi_deployments: must be of the form /<stack>

```
esc env webhook new [<org-name>/][/]<environment-name> <webhook-display-name> [flags]
```

## Options

```
      --active              Whether the webhook is active (default true)
      --event stringArray   Event types to subscribe to (repeatable)
      --format string       The payload format (default "raw")
      --group stringArray   Event groups to subscribe to (repeatable)
  -h, --help                help for new
      --secret string       Shared secret used to sign deliveries
      --url string          The payload URL to deliver events to (required)
```

## Options inherited from parent commands

```
      --env string   The name of the environment to operate on.
```

## SEE ALSO

* [esc env webhook](/docs/esc/cli/commands/esc_env_webhook/)	 - Manage environment webhooks


