admin

Create a hook

post/admin/hooks

Request

  • Base URL
    https://demo.gitea.com/api/v1
  • Auth
    • HTTP basic
    • or API key in query parameter token
    • or API key in query parameter access_token
    • or API key in header Authorization
    • or API key in query parameter sudo
    • or API key in header Sudo
    • or API key in header X-GITEA-OTP
  • TypeScript
    A function with typed inputs. Its response is checked against the schema.

Request body

activeboolean

Whether the webhook should be active upon creation

authorization_headerstring

Authorization header to include in webhook requests

branch_filterstring

Branch filter pattern to determine which branches trigger the webhook

configCreateHookOptionConfig required

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

eventsstring[]

List of events that will trigger this webhook

namestring

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

Hook

activeboolean

Whether the webhook is active and will be triggered

authorization_headerstring

Authorization header to include in webhook requests

branch_filterstring

Branch filter pattern to determine which branches trigger the webhook

configobject

Configuration settings for the webhook

created_atstring date-time

The date and time when the webhook was created

eventsstring[]

List of events that trigger this webhook

idinteger

The unique identifier of the webhook

namestring

Optional human-readable name for the webhook

typestring

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

updated_atstring date-time

The date and time when the webhook was last updated

Changes

No recorded changes to this operation across all 12 revisions of this API.