---
title: "Create a hook"
method: POST
path: "/admin/hooks"
tags: ["admin"]
---

# Create a hook

`POST /admin/hooks`

## Request body

- CreateHookOption — CreateHookOption options when create a hook
  - `active` boolean — Whether the webhook should be active upon creation
  - `authorization_header` string — Authorization header to include in webhook requests
  - `branch_filter` string — Branch filter pattern to determine which branches trigger the webhook
  - `config` CreateHookOptionConfig, required — CreateHookOptionConfig has all config options in it required are "content_type" and "url" Required
  - `events` string[] — List of events that will trigger this webhook
  - `name` string — Optional human-readable name for the webhook
  - `type` 'dingtalk' | 'discord' | 'gitea' | 'gogs' | 'msteams' | 'slack' | 'telegram' | 'feishu' | 'wechatwork' | 'packagist', required — The type of the webhook to create

## Response `201`

Hook

- Hook — Hook a hook is a web hook when one repository changed
  - `active` boolean — Whether the webhook is active and will be triggered
  - `authorization_header` string — Authorization header to include in webhook requests
  - `branch_filter` string — Branch filter pattern to determine which branches trigger the webhook
  - `config` object — Configuration settings for the webhook
  - `created_at` string, date-time — The date and time when the webhook was created
  - `events` string[] — List of events that trigger this webhook
  - `id` integer — The unique identifier of the webhook
  - `name` string — Optional human-readable name for the webhook
  - `type` string — The type of the webhook (e.g., gitea, slack, discord)
  - `updated_at` string, date-time — The date and time when the webhook was last updated

---

[API](https://skmtc.net/gitea/apis/gitea-api.md) · [All operations](https://skmtc.net/gitea/apis/gitea-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gitea/gitea-api/versions/350de506cefa/schema)
