--- sidebar_position: 1 description: "Create a webhook" --- # gt webhook create Create a webhook ## Synopsis ```text Create a webhook that delivers events to a URL, by default as JSON for push events. Events: create, delete, fork, push, issues, issues_only, issue_assign, issue_label, issue_milestone, issue_comment, pull_request, pull_request_only, pull_request_assign, pull_request_label, pull_request_milestone, pull_request_comment, pull_request_review, pull_request_sync, pull_request_review_request, wiki, repository, release, package, status, workflow_run, workflow_job; issues and pull_request include every issue or pull request event. Types: gitea, gogs, slack, discord, dingtalk, telegram, msteams, feishu, matrix, wechatwork, packagist. Slack webhooks need --config channel=#name (username, icon_url and color are optional). Gitea reads no other settings from --config, so set up discord, matrix and packagist webhooks in the web UI. ``` ``` gt webhook create [] [flags] ``` ## Examples ``` $ gt webhook create https://ci.example.com/hooks/gitea --events push,pull_request # sign deliveries with a secret read from a file $ gt webhook create https://ci.example.com/hooks/gitea --secret-file secret.txt # notify a Slack channel about releases of an organization's repositories $ gt webhook create https://hooks.slack.com/services/T0/B0/X --org acme --type slack --config channel=#releases --events release ``` ## Options ``` --active Deliver events (use --active=false to create the webhook paused) (default true) --authorization-header string Authorization value (prefer file input) --authorization-header-file string Read authorization value from file or - --branch-filter string Branch glob for push events --clear-authorization Send no authorization header; on edit, this removes the stored one --config stringToString Adapter-specific configuration, for example channel=alerts (default []) --events strings Events that trigger the webhook, comma-separated (default [push]) -h, --help help for create --secret string Signing secret (prefer --secret-file) --secret-file string Read signing secret from file or - --type string Webhook adapter type {gitea|gogs|slack|discord|dingtalk|telegram|msteams|feishu|matrix|wechatwork|packagist} (default "gitea") --url string Delivery URL ``` ## Options inherited from parent commands ``` --account Manage the webhooks of your account --cwd directory Working directory for repository discovery --debug Log the method, URL, status, and duration of each HTTP request to stderr --global Manage the system webhooks of the instance (administrators) --host URL Gitea instance URL, including any base path --interactive Allow prompts with machine output -q, --jq expression Filter JSON output using a jq expression; implies --json --json fields[="*"] Output JSON with the specified comma-separated fields, or all fields --no-input Disable prompts and implicit editor/browser interactions --org string Manage the webhooks of an organization --remote remote Git remote used for repository discovery -R, --repo OWNER/REPO Select a repository as OWNER/REPO or URL --sudo user Perform API requests as this user (requires an administrator account) --user name Account name on the selected instance -y, --yes Accept confirmations without prompting ``` ## SEE ALSO * [gt webhook](../webhook/index.md): Manage webhooks