Help Center/ CodeArts Repo/ API Reference/ APIs/ Webhook/ Querying a Webhook of a Specified Repository
Updated on 2025-03-28 GMT+08:00

Querying a Webhook of a Specified Repository

Function

This API is used to obtain a webhook of a specified repository.

URI

GET /v1/repositories/{group_name}/{repository_name}/hooks

Table 1 Path parameters

Parameter

Mandatory

Type

Description

group_name

Yes

String

Explanation:

Project ID (the segment between the domain name and repository name in a clone address. Example: 2bc940921d964b86951950f5de1axxxx in git@repo.alpha.devcloud.intest.com:2bc940921d964b86951950f5de1axxxx/testword.git).

Constraints:

None

Range:

32 digits and letters.

Default value:

None

repository_name

Yes

String

Explanation:

Repository name.

Constraints:

None

Range:

2–255 characters, including letters, digits, underscores (_), hyphens (-), periods (.).

Default value:

None

Table 2 Query parameters

Parameter

Mandatory

Type

Description

hook_id

No

String

Explanation:

Webhook ID.

Constraints:

None

Range:

0–2147483647

Default value:

None

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Explanation:

User token. It can be obtained by calling the corresponding IAM API. The value of X-Subject-Token in the response header is the user token.

Constraints:

Mandatory

Range:

1–100,000 characters.

Default value:

None

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

error

Error object

Explanation:

Response error.

Range:

None

result

RepoListHook object

Explanation:

Response result.

Range:

None

status

String

Explanation:

Response status of the API.

Range:

  • success: The API call is successful.
  • failed: The API call failed.
Table 5 Error

Parameter

Type

Description

code

String

Explanation:

Error code returned when the API fails to be called.

Range:

  • CH.010117: The specified repository does not exist. Check the request parameters.
  • CH.051020: Failed to query the repository webhook. Check the webhook ID.

message

String

Explanation:

Error message returned when the API fails to be called.

Table 6 RepoListHook

Parameter

Type

Description

hooks

Array of RepoHook objects

Repository webhook list.

Table 7 RepoHook

Parameter

Type

Description

id

Integer

Webhook ID.

project_id

Integer

Repository ID.

created_at

String

Time when the webhook was created.

enable_ssl_verification

Boolean

Whether to use SSL authentication.

push_events

Boolean

Whether to trigger push_events.

tag_push_events

Boolean

Whether to trigger tag_push_events.

repository_update_events

Boolean

Whether to trigger repository_update_events.

merge_requests_events

Boolean

Whether to trigger merge_requests_events.

issues_events

Boolean

Whether to trigger issues_events.

note_events

Boolean

Whether to trigger note_events.

pipeline_events

Boolean

Whether to trigger pipeline_events.

wiki_page_events

Boolean

Whether to trigger wiki_page_events.

Example Requests

GET https://{endpoint}/v1/repositories/{group_name}/{repository_name}/hooks

Example Responses

Status code: 200

OK

{
  "result" : {
    "hooks" : [ {
      "id" : 2111600786,
      "project_id" : 2111615967,
      "created_at" : "2021-11-09 16:35:15",
      "enable_ssl_verification" : false,
      "push_events" : true,
      "tag_push_events" : false,
      "repository_update_events" : false,
      "merge_requests_events" : false,
      "issues_events" : false,
      "note_events" : false,
      "pipeline_events" : false,
      "wiki_page_events" : false
    } ]
  },
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.