POST
/admin/hooksCreate a global system webhook
Creates a global system webhook with a configured delivery type and destination. Supply type and config, including the required content_type and url configuration values, and optionally set events and activation options. A 201 response returns the created hook.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
Global webhook definition containing its delivery type, configuration, and optional event and activation settings.
activebooleanoptional
Whether the webhook is active; defaults to false when omitted.
authorization_headerstringoptional
The authorization header value to include when delivering webhook requests.
branch_filterstringoptional
The branch pattern that limits which branch changes trigger the webhook.
configobjectrequired
CreateHookOptionConfig has all config options in it
required are "content_type" and "url" Required
eventsarray<string>optional
The list of events that trigger webhook deliveries.
typestringrequired
The webhook integration type: forgejo, dingtalk, discord, gitea, gogs, msteams, slack, telegram, feishu, wechatwork, or packagist.
201Returns the created hook object with its identifier, type, activation status, event list, configuration, URL, and creation and update timestamps.
activebooleanoptional
authorization_headerstringoptional
branch_filterstringoptional
configobjectoptional
Deprecated: use Metadata instead
content_typestringoptional
created_atstringoptional
eventsarray<string>optional
idintegeroptional
metadataunknownoptional
typestringoptional
updated_atstringoptional
urlstringoptional
Error handling
type and config are required. type must be one of: forgejo, dingtalk, discord, gitea, gogs, msteams, slack, telegram, feishu, wechatwork, or packagist. The config object must include content_type and url.