跳转到内容
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
This is the documentation of the next version, still under development. See the latest release.

Create a hook

POST
/orgs/{org}/hooks
curl --request POST \
--url https://gitea.com/api/v1/orgs/example/hooks \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "active": false, "authorization_header": "example", "branch_filter": "example", "config": { "additionalProperty": "example" }, "events": [ "example" ], "name": "example", "type": "dingtalk" }'
org
required
string

Name of the organization

Media typeapplication/json

CreateHookOption options when create a hook

object
active

Whether the webhook should be active upon creation

boolean
authorization_header

Authorization header to include in webhook requests

string
branch_filter

Branch filter pattern to determine which branches trigger the webhook

string
config
required

CreateHookOptionConfig has all config options in it required are “content_type” and “url” Required

object
key
additional properties
string
events

List of events that will trigger this webhook

Array<string>
name

Optional human-readable name for the webhook

string
type
required

The type of the webhook to create

string
Allowed values: dingtalk discord gitea gogs msteams slack telegram feishu wechatwork packagist

Hook

Media typeapplication/json

Hook a hook is a web hook when one repository changed

object
active

Whether the webhook is active and will be triggered

boolean
authorization_header

Authorization header to include in webhook requests

string
branch_filter

Branch filter pattern to determine which branches trigger the webhook

string
config

Configuration settings for the webhook

object
key
additional properties
string
created_at

The date and time when the webhook was created

string format: date-time
events

List of events that trigger this webhook

Array<string>
id

The unique identifier of the webhook

integer format: int64
name

Optional human-readable name for the webhook

string
type

The type of the webhook (e.g., gitea, slack, discord)

string
updated_at

The date and time when the webhook was last updated

string format: date-time
Examplegenerated
{
"active": true,
"authorization_header": "example",
"branch_filter": "example",
"config": {
"additionalProperty": "example"
},
"created_at": "2026-04-15T12:00:00Z",
"events": [
"example"
],
"id": 1,
"name": "example",
"type": "example",
"updated_at": "2026-04-15T12:00:00Z"
}

APINotFound is a not found empty response

Media typeapplication/json