跳到主要内容

Create WebHooks for a Repository

POST 

/api/v5/repos/:owner/:repo/hooks

Request​

Path Parameters

    owner stringrequired

    Repository space address (address path of the enterprise, organization, or individual)

    repo stringrequired

    Repository path (path)

Query Parameters

    access_token stringrequired

    User authorization code

Body

    urlstringrequired

    Remote HTTP URL

    encryption_typeinteger

    Encryption Type: 0: Password, 1: Signature Key

    passwordstring

    This password is included when requesting the URL to prevent malicious requests.

    push_eventsboolean

    Push code to the repository

    tag_push_eventsboolean

    Submit the tag to the repository

    issues_eventsboolean

    Create/Close Issue

    note_eventsboolean

    Commented on Issue/Code, etc.

    merge_requests_eventsboolean

    merge_request_and_post_merge

Responses​

Successful Response

Response Headers
    Schema
      idinteger
      urlstring
      passwordstring
      resultnull
      project_idinteger
      result_codeinteger
      push_eventsinteger
      tag_push_eventsinteger
      issues_eventsinteger
      note_eventsinteger
      merge_requests_eventsinteger
      created_atstring