InfoGrab DocsInfoGrab Docs

그룹 웹훅 API

요약

이 API를 사용하여 그룹 웹훅을 관리합니다. 지정한 그룹의 모든 그룹 훅을 나열합니다. 시작 날짜로부터 지난 7일간 지정한 그룹 훅의 모든 이벤트를 나열합니다. 이 엔드포인트는 각 훅 및 인증된 사용자당 분당 5개 요청의 속도 제한이 있습니다.

이 API를 사용하여 그룹 웹훅을 관리합니다. 그룹 웹훅은 인스턴스 전체에 영향을 미치는 시스템 훅이나 단일 프로젝트에 제한된 프로젝트 웹훅과는 다릅니다.

사전 조건:

  • Administrator이거나 해당 그룹의 Owner 권한이 있어야 합니다.

모든 그룹 훅 목록 조회#

지정한 그룹의 모든 그룹 훅을 나열합니다.

GET /groups/:id/hooks

지원되는 속성:

Attribute Type Required Description
id integer or string yes 그룹의 ID 또는 URL 인코딩된 경로.

예시 요청:

curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks"

예시 응답:

[
  {
    "id": 1,
    "url": "http://example.com/hook",
    "name": "Test group hook",
    "description": "This is a test group hook.",
    "created_at": "2024-09-01T09:10:54.854Z",
    "push_events": true,
    "tag_push_events": false,
    "merge_requests_events": false,
    "repository_update_events": false,
    "enable_ssl_verification": true,
    "alert_status": "executable",
    "disabled_until": null,
    "url_variables": [],
    "push_events_branch_filter": null,
    "branch_filter_strategy": "all_branches",
    "group_id": 99,
    "issues_events": false,
    "confidential_issues_events": false,
    "note_events": false,
    "confidential_note_events": false,
    "pipeline_events": false,
    "wiki_page_events": false,
    "job_events": false,
    "deployment_events": false,
    "feature_flag_events": false,
    "releases_events": false,
    "milestone_events": false,
    "subgroup_events": false,
    "emoji_events": false,
    "resource_access_token_events": false,
    "member_events": false,
    "project_events": false,
    "custom_webhook_template": "{\"event\":\"{{object_kind}}\"}",
    "custom_headers": [
      {
        "key": "Authorization"
      }
    ],
    "token_present": false,
    "signing_token_present": false
  }
]

그룹 훅 조회#

히스토리
  • namedescription 속성이 GitLab 17.1에서 도입됨.
  • token_presentsigning_token_present 속성이 GitLab 19.0에서 도입됨.

지정한 그룹 훅을 조회합니다.

GET /groups/:id/hooks/:hook_id

지원되는 속성:

Attribute Type Required Description
id integer or string yes 그룹의 ID 또는 URL 인코딩된 경로.
hook_id integer yes 그룹 훅의 ID.

예시 요청:

curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1"

예시 응답:

{
  "id": 1,
  "url": "http://example.com/hook",
  "name": "Hook name",
  "description": "Hook description",
  "group_id": 3,
  "push_events": true,
  "push_events_branch_filter": "",
  "branch_filter_strategy": "wildcard",
  "issues_events": true,
  "confidential_issues_events": true,
  "merge_requests_events": true,
  "tag_push_events": true,
  "note_events": true,
  "confidential_note_events": true,
  "job_events": true,
  "pipeline_events": true,
  "wiki_page_events": true,
  "deployment_events": true,
  "feature_flag_events": false,
  "releases_events": true,
  "milestone_events": false,
  "subgroup_events": true,
  "member_events": true,
  "project_events": true,
  "enable_ssl_verification": true,
  "repository_update_events": false,
  "alert_status": "executable",
  "disabled_until": null,
  "url_variables": [ ],
  "created_at": "2012-10-12T17:04:47Z",
  "resource_access_token_events": true,
  "custom_webhook_template": "{\"event\":\"{{object_kind}}\"}",
  "custom_headers": [
    {
      "key": "Authorization"
    }
  ],
  "token_present": false,
  "signing_token_present": false
}

모든 그룹 훅 이벤트 목록 조회#

히스토리

시작 날짜로부터 지난 7일간 지정한 그룹 훅의 모든 이벤트를 나열합니다.

GET /groups/:id/hooks/:hook_id/events

지원되는 속성:

Attribute Type Required Description
hook_id Integer Yes 프로젝트 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.
page Integer No 조회할 페이지 번호. 기본값은 1.
per_page Integer No 페이지당 반환할 레코드 수. 기본값은 20.
status Integer or string No 이벤트의 응답 상태 코드(예: 200 또는 500). 상태 범주로 검색할 수 있습니다: successful(200-299), client_failure(400-499), server_failure(500-599).

예시 요청:

curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1/events"

예시 응답:

[
  {
    "id": 1,
    "url": "https://example.net/",
    "trigger": "push_hooks",
    "request_headers": {
      "Content-Type": "application/json",
      "User-Agent": "GitLab/17.1.0-pre",
      "Idempotency-Key": "a5461c4d-9c7f-4af9-add6-cddebe3c426f",
      "X-Gitlab-Event": "Push Hook",
      "X-Gitlab-Webhook-UUID": "3c5c0404-c866-44bc-a5f6-452bb1bfc76e",
      "X-Gitlab-Instance": "https://gitlab.example.com",
      "X-Gitlab-Event-UUID": "9cebe914-4827-408f-b014-cfa23a47a35f",
      "X-Gitlab-Token": "[REDACTED]"
    },
    "request_data": {
      "object_kind": "push",
      "event_name": "push",
      "after": "f15b32277d2c55c6c595845a87109b09c913c556",
      "ref": "refs/heads/master",
      "ref_protected": true,
      "checkout_sha": "f15b32277d2c55c6c595845a87109b09c913c556",
      "message": null,
      "user_id": 1,
      "user_name": "Administrator",
      "user_username": "root",
      "user_email": null,
      "user_avatar": "https://www.gravatar.com/avatar/13efe0d4559475ba84ecc802061febbdea6e224fcbffd7ec7da9cd431845299c?s=80&d=identicon",
      "project_id": 7,
      "project": {
        "id": 7,
        "name": "Flight",
        "description": "Incidunt ea ab officia a veniam.",
        "web_url": "https://gitlab.example.com/flightjs/Flight",
        "avatar_url": null,
        "git_ssh_url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "git_http_url": "https://gitlab.example.com/flightjs/Flight.git",
        "namespace": "Flightjs",
        "visibility_level": 10,
        "path_with_namespace": "flightjs/Flight",
        "default_branch": "master",
        "ci_config_path": null,
        "homepage": "https://gitlab.example.com/flightjs/Flight",
        "url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "ssh_url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "http_url": "https://gitlab.example.com/flightjs/Flight.git"
      },
      "commits": [
        {
          "id": "f15b32277d2c55c6c595845a87109b09c913c556",
          "message": "v1.5.2\n",
          "title": "v1.5.2",
          "timestamp": "2017-06-19T14:39:53-07:00",
          "url": "https://gitlab.example.com/flightjs/Flight/-/commit/f15b32277d2c55c6c595845a87109b09c913c556",
          "author": {
            "name": "Andrew Lunny",
            "email": "[REDACTED]"
          },
          "added": [],
          "modified": [
            "package.json"
          ],
          "removed": []
        },
        {
          "id": "8749d49930866a4871fa086adbd7d2057fcc3ebb",
          "message": "Merge pull request #378 from flightjs/alunny/publish_lib\n\npublish lib and index to npm",
          "title": "Merge pull request #378 from flightjs/alunny/publish_lib",
          "timestamp": "2017-06-16T10:26:39-07:00",
          "url": "https://gitlab.example.com/flightjs/Flight/-/commit/8749d49930866a4871fa086adbd7d2057fcc3ebb",
          "author": {
            "name": "angus croll",
            "email": "[REDACTED]"
          },
          "added": [],
          "modified": [
            "package.json"
          ],
          "removed": []
        },
        {
          "id": "468abc807a2b2572f43e72c743b76cee6db24025",
          "message": "publish lib and index to npm\n",
          "title": "publish lib and index to npm",
          "timestamp": "2017-06-16T10:23:04-07:00",
          "url": "https://gitlab.example.com/flightjs/Flight/-/commit/468abc807a2b2572f43e72c743b76cee6db24025",
          "author": {
            "name": "Andrew Lunny",
            "email": "[REDACTED]"
          },
          "added": [],
          "modified": [
            "package.json"
          ],
          "removed": []
        }
      ],
      "total_commits_count": 3,
      "push_options": {},
      "repository": {
        "name": "Flight",
        "url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "description": "Incidunt ea ab officia a veniam.",
        "homepage": "https://gitlab.example.com/flightjs/Flight",
        "git_http_url": "https://gitlab.example.com/flightjs/Flight.git",
        "git_ssh_url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "visibility_level": 10
      }
    },
    "response_headers": {
      "Date": "Sun, 26 May 2024 03:03:17 GMT",
      "Content-Type": "application/json; charset=utf-8",
      "Content-Length": "16",
      "Connection": "close",
      "X-Powered-By": "Express",
      "Access-Control-Allow-Origin": "*",
      "X-Pd-Status": "sent to primary"
    },
    "response_body": "{\"success\":true}",
    "execution_duration": 1.0906479999999874,
    "response_status": "200"
  },
  {
    "id": 2,
    "url": "https://example.net/",
    "trigger": "push_hooks",
    "request_headers": {
      "Content-Type": "application/json",
      "User-Agent": "GitLab/17.1.0-pre",
      "Idempotency-Key": "1f0a54f0-0529-408d-a5b8-a2a98ff5f94a",
      "X-Gitlab-Event": "Push Hook",
      "X-Gitlab-Webhook-UUID": "a753eedb-1d72-4549-9ca7-eac8ea8e50dd",
      "X-Gitlab-Instance": "https://gitlab.example.com:3000",
      "X-Gitlab-Event-UUID": "842d7c3e-3114-4396-8a95-66c084d53cb1",
      "X-Gitlab-Token": "[REDACTED]"
    },
    "request_data": {
      "object_kind": "push",
      "event_name": "push",
      "before": "468abc807a2b2572f43e72c743b76cee6db24025",
      "after": "f15b32277d2c55c6c595845a87109b09c913c556",
      "ref": "refs/heads/master",
      "ref_protected": true,
      "checkout_sha": "f15b32277d2c55c6c595845a87109b09c913c556",
      "message": null,
      "user_id": 1,
      "user_name": "Administrator",
      "user_username": "root",
      "user_email": null,
      "user_avatar": "https://www.gravatar.com/avatar/13efe0d4559475ba84ecc802061febbdea6e224fcbffd7ec7da9cd431845299c?s=80&d=identicon",
      "project_id": 7,
      "project": {
        "id": 7,
        "name": "Flight",
        "description": "Incidunt ea ab officia a veniam.",
        "web_url": "https://gitlab.example.com/flightjs/Flight",
        "avatar_url": null,
        "git_ssh_url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "git_http_url": "https://gitlab.example.com/flightjs/Flight.git",
        "namespace": "Flightjs",
        "visibility_level": 10,
        "path_with_namespace": "flightjs/Flight",
        "default_branch": "master",
        "ci_config_path": null,
        "homepage": "https://gitlab.example.com/flightjs/Flight",
        "url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "ssh_url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "http_url": "https://gitlab.example.com/flightjs/Flight.git"
      },
      "commits": [
        {
          "id": "f15b32277d2c55c6c595845a87109b09c913c556",
          "message": "v1.5.2\n",
          "title": "v1.5.2",
          "timestamp": "2017-06-19T14:39:53-07:00",
          "url": "https://gitlab.example.com/flightjs/Flight/-/commit/f15b32277d2c55c6c595845a87109b09c913c556",
          "author": {
            "name": "Andrew Lunny",
            "email": "[REDACTED]"
          },
          "added": [],
          "modified": [
            "package.json"
          ],
          "removed": []
        },
        {
          "id": "8749d49930866a4871fa086adbd7d2057fcc3ebb",
          "message": "Merge pull request #378 from flightjs/alunny/publish_lib\n\npublish lib and index to npm",
          "title": "Merge pull request #378 from flightjs/alunny/publish_lib",
          "timestamp": "2017-06-16T10:26:39-07:00",
          "url": "https://gitlab.example.com/flightjs/Flight/-/commit/8749d49930866a4871fa086adbd7d2057fcc3ebb",
          "author": {
            "name": "angus croll",
            "email": "[REDACTED]"
          },
          "added": [],
          "modified": [
            "package.json"
          ],
          "removed": []
        },
        {
          "id": "468abc807a2b2572f43e72c743b76cee6db24025",
          "message": "publish lib and index to npm\n",
          "title": "publish lib and index to npm",
          "timestamp": "2017-06-16T10:23:04-07:00",
          "url": "https://gitlab.example.com/flightjs/Flight/-/commit/468abc807a2b2572f43e72c743b76cee6db24025",
          "author": {
            "name": "Andrew Lunny",
            "email": "[REDACTED]"
          },
          "added": [],
          "modified": [
            "package.json"
          ],
          "removed": []
        }
      ],
      "total_commits_count": 3,
      "push_options": {},
      "repository": {
        "name": "Flight",
        "url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "description": "Incidunt ea ab officia a veniam.",
        "homepage": "https://gitlab.example.com/flightjs/Flight",
        "git_http_url": "https://gitlab.example.com/flightjs/Flight.git",
        "git_ssh_url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "visibility_level": 10
      }
    },
    "response_headers": {
      "Date": "Sun, 26 May 2024 03:03:19 GMT",
      "Content-Type": "application/json; charset=utf-8",
      "Content-Length": "16",
      "Connection": "close",
      "X-Powered-By": "Express",
      "Access-Control-Allow-Origin": "*",
      "X-Pd-Status": "sent to primary"
    },
    "response_body": "{\"success\":true}",
    "execution_duration": 1.0716120000000728,
    "response_status": "200"
  }
]

그룹 훅 이벤트 재전송#

히스토리

특정 훅 이벤트를 재전송합니다.

이 엔드포인트는 각 훅 및 인증된 사용자당 분당 5개 요청의 속도 제한이 있습니다. GitLab Self-Managed 및 GitLab Dedicated에서 이 제한을 비활성화하려면 관리자가 web_hook_event_resend_api_endpoint_rate_limit라는 이름의 기능 플래그를 비활성화할 수 있습니다.

POST /groups/:id/hooks/:hook_id/events/:hook_event_id/resend

지원되는 속성:

Attribute Type Required Description
hook_event_id Integer Yes 훅 이벤트의 ID.
hook_id Integer Yes 그룹 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.

예시 요청:

curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1/events/1/resend"

예시 응답:

{
  "response_status": 200
}

그룹 훅 생성#

히스토리
  • namedescription 속성이 GitLab 17.1에서 도입됨.
  • signing_token 속성이 GitLab 19.0에서 webhook_signing_token이라는 이름의 기능 플래그와 함께 도입됨. 기본적으로 활성화됨.

  • 기능 플래그 webhook_signing_token이 GitLab 19.1에서 제거됨.

지정한 그룹에 그룹 훅을 생성합니다.

POST /groups/:id/hooks

지원되는 속성:

Attribute Type Required Description
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.
url String Yes 훅 URL.
branch_filter_strategy String No 브랜치별 푸시 이벤트 필터링. 가능한 값은 wildcard(기본값), regex, all_branches.
confidential_issues_events Boolean No 기밀 이슈 이벤트 시 훅 트리거.
confidential_note_events Boolean No 기밀 노트 이벤트 시 훅 트리거.
custom_headers Array No 훅의 커스텀 헤더.
custom_webhook_template String No 훅의 커스텀 웹훅 템플릿.
deployment_events Boolean No 배포 이벤트 시 훅 트리거.
description String No 훅 설명(GitLab 17.1에서 도입).
enable_ssl_verification Boolean No 훅 트리거 시 SSL 검증 수행.
feature_flag_events Boolean No 기능 플래그 이벤트 시 훅 트리거.
issues_events Boolean No 이슈 이벤트 시 훅 트리거.
job_events Boolean No job 이벤트 시 훅 트리거.
member_events Boolean No 멤버 이벤트 시 훅 트리거.
merge_requests_events Boolean No 머지 리퀘스트 이벤트 시 훅 트리거.
milestone_events Boolean No 마일스톤 이벤트 시 훅 트리거.
name String No 훅 이름(GitLab 17.1에서 도입).
note_events Boolean No 노트 이벤트 시 훅 트리거.
pipeline_events Boolean No 파이프라인 이벤트 시 훅 트리거.
project_events Boolean No 프로젝트 이벤트 시 훅 트리거.
push_events Boolean No 푸시 이벤트 시 훅 트리거.
push_events_branch_filter String No 일치하는 브랜치에 대한 푸시 이벤트 시에만 훅 트리거.
releases_events Boolean No 릴리즈 이벤트 시 훅 트리거.
resource_access_token_events Boolean No 프로젝트 액세스 토큰 만료 이벤트 시 훅 트리거.
signing_token String No webhook-signature 헤더 계산에 사용되는 HMAC 서명 토큰. 32바이트 키를 인코딩하는 whsec_ 형식이어야 합니다. 응답에 반환되지 않음.
subgroup_events Boolean No 하위 그룹 이벤트 시 훅 트리거.
tag_push_events Boolean No 태그 푸시 이벤트 시 훅 트리거.
token String No 수신한 페이로드를 검증하기 위한 시크릿 토큰. 응답에 반환되지 않음.
wiki_page_events Boolean No 위키 페이지 이벤트 시 훅 트리거.

예시 요청:

curl --request POST \
  --header "content-type: application/json" \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks" \
  --data '{"url": "https://example.com/hook", "name": "My Hook", "description": "Hook description"}'

예시 응답:

{
  "id": 42,
  "url": "https://example.com/hook",
  "name": "My Hook",
  "description": "Hook description",
  "group_id": 3,
  "push_events": true,
  "push_events_branch_filter": "",
  "branch_filter_strategy": "wildcard",
  "issues_events": true,
  "confidential_issues_events": true,
  "merge_requests_events": true,
  "tag_push_events": true,
  "note_events": true,
  "confidential_note_events": true,
  "job_events": true,
  "pipeline_events": true,
  "wiki_page_events": true,
  "deployment_events": true,
  "feature_flag_events": true,
  "releases_events": true,
  "milestone_events": true,
  "subgroup_events": true,
  "member_events": true,
  "project_events": true,
  "enable_ssl_verification": true,
  "repository_update_events": false,
  "alert_status": "executable",
  "disabled_until": null,
  "url_variables": [ ],
  "created_at": "2012-10-12T17:04:47Z",
  "resource_access_token_events": true,
  "custom_webhook_template": "{\"event\":\"{{object_kind}}\"}",
  "token_present": false,
  "signing_token_present": false
}

그룹 훅 수정#

히스토리
  • namedescription 속성이 GitLab 17.1에서 도입됨.
  • signing_token 속성이 GitLab 19.0에서 webhook_signing_token이라는 이름의 기능 플래그와 함께 도입됨. 기본적으로 활성화됨.

  • 기능 플래그 webhook_signing_token이 GitLab 19.1에서 제거됨.

지정한 그룹의 그룹 훅을 수정합니다.

PUT /groups/:id/hooks/:hook_id

지원되는 속성:

Attribute Type Required Description
hook_id Integer Yes 그룹 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.
url String Yes 훅 URL.
branch_filter_strategy String No 브랜치별 푸시 이벤트 필터링. 가능한 값은 wildcard(기본값), regex, all_branches.
confidential_issues_events Boolean No 기밀 이슈 이벤트 시 훅 트리거.
confidential_note_events Boolean No 기밀 노트 이벤트 시 훅 트리거.
custom_headers Array No 훅의 커스텀 헤더.
custom_webhook_template String No 훅의 커스텀 웹훅 템플릿.
deployment_events Boolean No 배포 이벤트 시 훅 트리거.
description String No 훅 설명.
enable_ssl_verification Boolean No 훅 트리거 시 SSL 검증 수행.
feature_flag_events Boolean No 기능 플래그 이벤트 시 훅 트리거.
issues_events Boolean No 이슈 이벤트 시 훅 트리거.
job_events Boolean No job 이벤트 시 훅 트리거.
member_events Boolean No 멤버 이벤트 시 훅 트리거.
merge_requests_events Boolean No 머지 리퀘스트 이벤트 시 훅 트리거.
milestone_events Boolean No 마일스톤 이벤트 시 훅 트리거.
name String No 훅 이름.
note_events Boolean No 노트 이벤트 시 훅 트리거.
pipeline_events Boolean No 파이프라인 이벤트 시 훅 트리거.
project_events Boolean No 프로젝트 이벤트 시 훅 트리거.
push_events Boolean No 푸시 이벤트 시 훅 트리거.
push_events_branch_filter String No 일치하는 브랜치에 대한 푸시 이벤트 시에만 훅 트리거.
releases_events Boolean No 릴리즈 이벤트 시 훅 트리거.
resource_access_token_events Boolean No 프로젝트 액세스 토큰 만료 이벤트 시 훅 트리거.
service_access_tokens_expiration_enforced Boolean No 서비스 계정 액세스 토큰에 만료일 필수 지정.
signing_token String No webhook-signature 헤더 계산에 사용되는 HMAC 서명 토큰. 32바이트 키를 인코딩하는 whsec_ 형식이어야 합니다. 응답에 반환되지 않음.
subgroup_events Boolean No 하위 그룹 이벤트 시 훅 트리거.
tag_push_events Boolean No 태그 푸시 이벤트 시 훅 트리거.
token String No 수신한 페이로드를 검증하기 위한 시크릿 토큰. 응답에 반환되지 않음. 웹훅 URL을 변경하면 시크릿 토큰이 초기화되어 유지되지 않습니다.
wiki_page_events Boolean No 위키 페이지 이벤트 시 훅 트리거.

예시 요청:

curl --request POST \
  --header "content-type: application/json" \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1" \
  --data '{"url": "https://example.com/hook", "name": "New hook name", "description": "Changed hook description"}'

예시 응답:

{
  "id": 1,
  "url": "https://example.com/hook",
  "name": "New hook name",
  "description": "Changed hook description",
  "group_id": 3,
  "push_events": true,
  "push_events_branch_filter": "",
  "branch_filter_strategy": "wildcard",
  "issues_events": true,
  "confidential_issues_events": true,
  "merge_requests_events": true,
  "tag_push_events": true,
  "note_events": true,
  "confidential_note_events": true,
  "job_events": true,
  "pipeline_events": true,
  "wiki_page_events": true,
  "deployment_events": true,
  "feature_flag_events": true,
  "releases_events": true,
  "milestone_events": true,
  "subgroup_events": true,
  "member_events": true,
  "project_events": true,
  "enable_ssl_verification": true,
  "repository_update_events": false,
  "alert_status": "executable",
  "disabled_until": null,
  "url_variables": [ ],
  "created_at": "2012-10-12T17:04:47Z",
  "resource_access_token_events": true,
  "custom_webhook_template": "{\"event\":\"{{object_kind}}\"}",
  "custom_headers": [
    {
      "key": "Authorization"
    }
  ],
  "token_present": false,
  "signing_token_present": false
}

그룹 훅 삭제#

지정한 그룹 훅을 삭제합니다. 이 메서드는 멱등성을 가지며 여러 번 호출할 수 있습니다. 훅이 존재하거나 존재하지 않을 수 있습니다.

DELETE /groups/:id/hooks/:hook_id

지원되는 속성:

Attribute Type Required Description
hook_id Integer Yes 그룹 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.

예시 요청:

curl --request DELETE \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1"

성공 시 메시지가 반환되지 않습니다.

테스트 그룹 훅 트리거#

히스토리
  • 특별 속도 제한이 GitLab 17.1에서 web_hook_test_api_endpoint_rate_limit라는 이름의 기능 플래그와 함께 도입됨. 기본적으로 활성화됨.

지정한 그룹에 대한 테스트 훅을 트리거합니다.

이 엔드포인트는 각 그룹 및 인증된 사용자당 분당 5개 요청의 속도 제한이 있습니다. GitLab Self-Managed 및 GitLab Dedicated에서 이 제한을 비활성화하려면 관리자가 web_hook_test_api_endpoint_rate_limit라는 이름의 기능 플래그를 비활성화할 수 있습니다.

POST /groups/:id/hooks/:hook_id/test/:trigger
Attribute Type Required Description
hook_id Integer Yes 그룹 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.
trigger String Yes push_events, tag_push_events, issues_events, confidential_issues_events, note_events, merge_requests_events, job_events, pipeline_events, wiki_page_events, releases_events, milestone_events, emoji_events, resource_access_token_events 중 하나.

예시 요청:

curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1/test/push_events"

예시 응답:

{"message":"201 Created"}

커스텀 헤더 수정#

히스토리

지정한 그룹 훅의 커스텀 헤더를 수정합니다.

PUT /groups/:id/hooks/:hook_id/custom_headers/:key

지원되는 속성:

Attribute Type Required Description
hook_id Integer Yes 그룹 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.
key String Yes 커스텀 헤더의 키.
value String Yes 커스텀 헤더의 값.

예시 요청:

curl --request PUT \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1/custom_headers/header_key?value='header_value'"

성공 시 메시지가 반환되지 않습니다.

커스텀 헤더 삭제#

히스토리

커스텀 헤더를 삭제합니다.

DELETE /groups/:id/hooks/:hook_id/custom_headers/:key

지원되는 속성:

Attribute Type Required Description
hook_id Integer Yes 그룹 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.
key String Yes 커스텀 헤더의 키.

예시 요청:

curl --request DELETE \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1/custom_headers/header_key"

성공 시 메시지가 반환되지 않습니다.

URL 변수 수정#

히스토리

지정한 그룹 훅의 URL 변수를 수정합니다.

PUT /groups/:id/hooks/:hook_id/url_variables/:key

지원되는 속성:

Attribute Type Required Description
hook_id Integer Yes 그룹 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.
key String Yes URL 변수의 키.
value String Yes URL 변수의 값.

예시 요청:

curl --request PUT \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1/url_variables/my_key?value='my_key_value'"

성공 시 메시지가 반환되지 않습니다.

URL 변수 삭제#

지정한 그룹 훅의 URL 변수를 삭제합니다.

DELETE /groups/:id/hooks/:hook_id/url_variables/:key

지원되는 속성:

Attribute Type Required Description
hook_id Integer Yes 그룹 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.
key String Yes URL 변수의 키.

예시 요청:

curl --request DELETE \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1/url_variables/my_key"

그룹 웹훅 API

GitLab v19.2
Tier: Premium, Ultimate
Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
원문 보기
요약

이 API를 사용하여 그룹 웹훅을 관리합니다. 지정한 그룹의 모든 그룹 훅을 나열합니다. 시작 날짜로부터 지난 7일간 지정한 그룹 훅의 모든 이벤트를 나열합니다. 이 엔드포인트는 각 훅 및 인증된 사용자당 분당 5개 요청의 속도 제한이 있습니다.

이 API를 사용하여 그룹 웹훅을 관리합니다. 그룹 웹훅은 인스턴스 전체에 영향을 미치는 시스템 훅이나 단일 프로젝트에 제한된 프로젝트 웹훅과는 다릅니다.

사전 조건:

  • Administrator이거나 해당 그룹의 Owner 권한이 있어야 합니다.

모든 그룹 훅 목록 조회#

지정한 그룹의 모든 그룹 훅을 나열합니다.

GET /groups/:id/hooks

지원되는 속성:

Attribute Type Required Description
id integer or string yes 그룹의 ID 또는 URL 인코딩된 경로.

예시 요청:

curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks"

예시 응답:

[
  {
    "id": 1,
    "url": "http://example.com/hook",
    "name": "Test group hook",
    "description": "This is a test group hook.",
    "created_at": "2024-09-01T09:10:54.854Z",
    "push_events": true,
    "tag_push_events": false,
    "merge_requests_events": false,
    "repository_update_events": false,
    "enable_ssl_verification": true,
    "alert_status": "executable",
    "disabled_until": null,
    "url_variables": [],
    "push_events_branch_filter": null,
    "branch_filter_strategy": "all_branches",
    "group_id": 99,
    "issues_events": false,
    "confidential_issues_events": false,
    "note_events": false,
    "confidential_note_events": false,
    "pipeline_events": false,
    "wiki_page_events": false,
    "job_events": false,
    "deployment_events": false,
    "feature_flag_events": false,
    "releases_events": false,
    "milestone_events": false,
    "subgroup_events": false,
    "emoji_events": false,
    "resource_access_token_events": false,
    "member_events": false,
    "project_events": false,
    "custom_webhook_template": "{\"event\":\"{{object_kind}}\"}",
    "custom_headers": [
      {
        "key": "Authorization"
      }
    ],
    "token_present": false,
    "signing_token_present": false
  }
]

그룹 훅 조회#

히스토리
  • namedescription 속성이 GitLab 17.1에서 도입됨.
  • token_presentsigning_token_present 속성이 GitLab 19.0에서 도입됨.

지정한 그룹 훅을 조회합니다.

GET /groups/:id/hooks/:hook_id

지원되는 속성:

Attribute Type Required Description
id integer or string yes 그룹의 ID 또는 URL 인코딩된 경로.
hook_id integer yes 그룹 훅의 ID.

예시 요청:

curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1"

예시 응답:

{
  "id": 1,
  "url": "http://example.com/hook",
  "name": "Hook name",
  "description": "Hook description",
  "group_id": 3,
  "push_events": true,
  "push_events_branch_filter": "",
  "branch_filter_strategy": "wildcard",
  "issues_events": true,
  "confidential_issues_events": true,
  "merge_requests_events": true,
  "tag_push_events": true,
  "note_events": true,
  "confidential_note_events": true,
  "job_events": true,
  "pipeline_events": true,
  "wiki_page_events": true,
  "deployment_events": true,
  "feature_flag_events": false,
  "releases_events": true,
  "milestone_events": false,
  "subgroup_events": true,
  "member_events": true,
  "project_events": true,
  "enable_ssl_verification": true,
  "repository_update_events": false,
  "alert_status": "executable",
  "disabled_until": null,
  "url_variables": [ ],
  "created_at": "2012-10-12T17:04:47Z",
  "resource_access_token_events": true,
  "custom_webhook_template": "{\"event\":\"{{object_kind}}\"}",
  "custom_headers": [
    {
      "key": "Authorization"
    }
  ],
  "token_present": false,
  "signing_token_present": false
}

모든 그룹 훅 이벤트 목록 조회#

히스토리

시작 날짜로부터 지난 7일간 지정한 그룹 훅의 모든 이벤트를 나열합니다.

GET /groups/:id/hooks/:hook_id/events

지원되는 속성:

Attribute Type Required Description
hook_id Integer Yes 프로젝트 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.
page Integer No 조회할 페이지 번호. 기본값은 1.
per_page Integer No 페이지당 반환할 레코드 수. 기본값은 20.
status Integer or string No 이벤트의 응답 상태 코드(예: 200 또는 500). 상태 범주로 검색할 수 있습니다: successful(200-299), client_failure(400-499), server_failure(500-599).

예시 요청:

curl --request GET \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1/events"

예시 응답:

[
  {
    "id": 1,
    "url": "https://example.net/",
    "trigger": "push_hooks",
    "request_headers": {
      "Content-Type": "application/json",
      "User-Agent": "GitLab/17.1.0-pre",
      "Idempotency-Key": "a5461c4d-9c7f-4af9-add6-cddebe3c426f",
      "X-Gitlab-Event": "Push Hook",
      "X-Gitlab-Webhook-UUID": "3c5c0404-c866-44bc-a5f6-452bb1bfc76e",
      "X-Gitlab-Instance": "https://gitlab.example.com",
      "X-Gitlab-Event-UUID": "9cebe914-4827-408f-b014-cfa23a47a35f",
      "X-Gitlab-Token": "[REDACTED]"
    },
    "request_data": {
      "object_kind": "push",
      "event_name": "push",
      "after": "f15b32277d2c55c6c595845a87109b09c913c556",
      "ref": "refs/heads/master",
      "ref_protected": true,
      "checkout_sha": "f15b32277d2c55c6c595845a87109b09c913c556",
      "message": null,
      "user_id": 1,
      "user_name": "Administrator",
      "user_username": "root",
      "user_email": null,
      "user_avatar": "https://www.gravatar.com/avatar/13efe0d4559475ba84ecc802061febbdea6e224fcbffd7ec7da9cd431845299c?s=80&d=identicon",
      "project_id": 7,
      "project": {
        "id": 7,
        "name": "Flight",
        "description": "Incidunt ea ab officia a veniam.",
        "web_url": "https://gitlab.example.com/flightjs/Flight",
        "avatar_url": null,
        "git_ssh_url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "git_http_url": "https://gitlab.example.com/flightjs/Flight.git",
        "namespace": "Flightjs",
        "visibility_level": 10,
        "path_with_namespace": "flightjs/Flight",
        "default_branch": "master",
        "ci_config_path": null,
        "homepage": "https://gitlab.example.com/flightjs/Flight",
        "url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "ssh_url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "http_url": "https://gitlab.example.com/flightjs/Flight.git"
      },
      "commits": [
        {
          "id": "f15b32277d2c55c6c595845a87109b09c913c556",
          "message": "v1.5.2\n",
          "title": "v1.5.2",
          "timestamp": "2017-06-19T14:39:53-07:00",
          "url": "https://gitlab.example.com/flightjs/Flight/-/commit/f15b32277d2c55c6c595845a87109b09c913c556",
          "author": {
            "name": "Andrew Lunny",
            "email": "[REDACTED]"
          },
          "added": [],
          "modified": [
            "package.json"
          ],
          "removed": []
        },
        {
          "id": "8749d49930866a4871fa086adbd7d2057fcc3ebb",
          "message": "Merge pull request #378 from flightjs/alunny/publish_lib\n\npublish lib and index to npm",
          "title": "Merge pull request #378 from flightjs/alunny/publish_lib",
          "timestamp": "2017-06-16T10:26:39-07:00",
          "url": "https://gitlab.example.com/flightjs/Flight/-/commit/8749d49930866a4871fa086adbd7d2057fcc3ebb",
          "author": {
            "name": "angus croll",
            "email": "[REDACTED]"
          },
          "added": [],
          "modified": [
            "package.json"
          ],
          "removed": []
        },
        {
          "id": "468abc807a2b2572f43e72c743b76cee6db24025",
          "message": "publish lib and index to npm\n",
          "title": "publish lib and index to npm",
          "timestamp": "2017-06-16T10:23:04-07:00",
          "url": "https://gitlab.example.com/flightjs/Flight/-/commit/468abc807a2b2572f43e72c743b76cee6db24025",
          "author": {
            "name": "Andrew Lunny",
            "email": "[REDACTED]"
          },
          "added": [],
          "modified": [
            "package.json"
          ],
          "removed": []
        }
      ],
      "total_commits_count": 3,
      "push_options": {},
      "repository": {
        "name": "Flight",
        "url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "description": "Incidunt ea ab officia a veniam.",
        "homepage": "https://gitlab.example.com/flightjs/Flight",
        "git_http_url": "https://gitlab.example.com/flightjs/Flight.git",
        "git_ssh_url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "visibility_level": 10
      }
    },
    "response_headers": {
      "Date": "Sun, 26 May 2024 03:03:17 GMT",
      "Content-Type": "application/json; charset=utf-8",
      "Content-Length": "16",
      "Connection": "close",
      "X-Powered-By": "Express",
      "Access-Control-Allow-Origin": "*",
      "X-Pd-Status": "sent to primary"
    },
    "response_body": "{\"success\":true}",
    "execution_duration": 1.0906479999999874,
    "response_status": "200"
  },
  {
    "id": 2,
    "url": "https://example.net/",
    "trigger": "push_hooks",
    "request_headers": {
      "Content-Type": "application/json",
      "User-Agent": "GitLab/17.1.0-pre",
      "Idempotency-Key": "1f0a54f0-0529-408d-a5b8-a2a98ff5f94a",
      "X-Gitlab-Event": "Push Hook",
      "X-Gitlab-Webhook-UUID": "a753eedb-1d72-4549-9ca7-eac8ea8e50dd",
      "X-Gitlab-Instance": "https://gitlab.example.com:3000",
      "X-Gitlab-Event-UUID": "842d7c3e-3114-4396-8a95-66c084d53cb1",
      "X-Gitlab-Token": "[REDACTED]"
    },
    "request_data": {
      "object_kind": "push",
      "event_name": "push",
      "before": "468abc807a2b2572f43e72c743b76cee6db24025",
      "after": "f15b32277d2c55c6c595845a87109b09c913c556",
      "ref": "refs/heads/master",
      "ref_protected": true,
      "checkout_sha": "f15b32277d2c55c6c595845a87109b09c913c556",
      "message": null,
      "user_id": 1,
      "user_name": "Administrator",
      "user_username": "root",
      "user_email": null,
      "user_avatar": "https://www.gravatar.com/avatar/13efe0d4559475ba84ecc802061febbdea6e224fcbffd7ec7da9cd431845299c?s=80&d=identicon",
      "project_id": 7,
      "project": {
        "id": 7,
        "name": "Flight",
        "description": "Incidunt ea ab officia a veniam.",
        "web_url": "https://gitlab.example.com/flightjs/Flight",
        "avatar_url": null,
        "git_ssh_url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "git_http_url": "https://gitlab.example.com/flightjs/Flight.git",
        "namespace": "Flightjs",
        "visibility_level": 10,
        "path_with_namespace": "flightjs/Flight",
        "default_branch": "master",
        "ci_config_path": null,
        "homepage": "https://gitlab.example.com/flightjs/Flight",
        "url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "ssh_url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "http_url": "https://gitlab.example.com/flightjs/Flight.git"
      },
      "commits": [
        {
          "id": "f15b32277d2c55c6c595845a87109b09c913c556",
          "message": "v1.5.2\n",
          "title": "v1.5.2",
          "timestamp": "2017-06-19T14:39:53-07:00",
          "url": "https://gitlab.example.com/flightjs/Flight/-/commit/f15b32277d2c55c6c595845a87109b09c913c556",
          "author": {
            "name": "Andrew Lunny",
            "email": "[REDACTED]"
          },
          "added": [],
          "modified": [
            "package.json"
          ],
          "removed": []
        },
        {
          "id": "8749d49930866a4871fa086adbd7d2057fcc3ebb",
          "message": "Merge pull request #378 from flightjs/alunny/publish_lib\n\npublish lib and index to npm",
          "title": "Merge pull request #378 from flightjs/alunny/publish_lib",
          "timestamp": "2017-06-16T10:26:39-07:00",
          "url": "https://gitlab.example.com/flightjs/Flight/-/commit/8749d49930866a4871fa086adbd7d2057fcc3ebb",
          "author": {
            "name": "angus croll",
            "email": "[REDACTED]"
          },
          "added": [],
          "modified": [
            "package.json"
          ],
          "removed": []
        },
        {
          "id": "468abc807a2b2572f43e72c743b76cee6db24025",
          "message": "publish lib and index to npm\n",
          "title": "publish lib and index to npm",
          "timestamp": "2017-06-16T10:23:04-07:00",
          "url": "https://gitlab.example.com/flightjs/Flight/-/commit/468abc807a2b2572f43e72c743b76cee6db24025",
          "author": {
            "name": "Andrew Lunny",
            "email": "[REDACTED]"
          },
          "added": [],
          "modified": [
            "package.json"
          ],
          "removed": []
        }
      ],
      "total_commits_count": 3,
      "push_options": {},
      "repository": {
        "name": "Flight",
        "url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "description": "Incidunt ea ab officia a veniam.",
        "homepage": "https://gitlab.example.com/flightjs/Flight",
        "git_http_url": "https://gitlab.example.com/flightjs/Flight.git",
        "git_ssh_url": "ssh://git@gitlab.example.com:2222/flightjs/Flight.git",
        "visibility_level": 10
      }
    },
    "response_headers": {
      "Date": "Sun, 26 May 2024 03:03:19 GMT",
      "Content-Type": "application/json; charset=utf-8",
      "Content-Length": "16",
      "Connection": "close",
      "X-Powered-By": "Express",
      "Access-Control-Allow-Origin": "*",
      "X-Pd-Status": "sent to primary"
    },
    "response_body": "{\"success\":true}",
    "execution_duration": 1.0716120000000728,
    "response_status": "200"
  }
]

그룹 훅 이벤트 재전송#

히스토리

특정 훅 이벤트를 재전송합니다.

이 엔드포인트는 각 훅 및 인증된 사용자당 분당 5개 요청의 속도 제한이 있습니다. GitLab Self-Managed 및 GitLab Dedicated에서 이 제한을 비활성화하려면 관리자가 web_hook_event_resend_api_endpoint_rate_limit라는 이름의 기능 플래그를 비활성화할 수 있습니다.

POST /groups/:id/hooks/:hook_id/events/:hook_event_id/resend

지원되는 속성:

Attribute Type Required Description
hook_event_id Integer Yes 훅 이벤트의 ID.
hook_id Integer Yes 그룹 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.

예시 요청:

curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1/events/1/resend"

예시 응답:

{
  "response_status": 200
}

그룹 훅 생성#

히스토리
  • namedescription 속성이 GitLab 17.1에서 도입됨.
  • signing_token 속성이 GitLab 19.0에서 webhook_signing_token이라는 이름의 기능 플래그와 함께 도입됨. 기본적으로 활성화됨.

  • 기능 플래그 webhook_signing_token이 GitLab 19.1에서 제거됨.

지정한 그룹에 그룹 훅을 생성합니다.

POST /groups/:id/hooks

지원되는 속성:

Attribute Type Required Description
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.
url String Yes 훅 URL.
branch_filter_strategy String No 브랜치별 푸시 이벤트 필터링. 가능한 값은 wildcard(기본값), regex, all_branches.
confidential_issues_events Boolean No 기밀 이슈 이벤트 시 훅 트리거.
confidential_note_events Boolean No 기밀 노트 이벤트 시 훅 트리거.
custom_headers Array No 훅의 커스텀 헤더.
custom_webhook_template String No 훅의 커스텀 웹훅 템플릿.
deployment_events Boolean No 배포 이벤트 시 훅 트리거.
description String No 훅 설명(GitLab 17.1에서 도입).
enable_ssl_verification Boolean No 훅 트리거 시 SSL 검증 수행.
feature_flag_events Boolean No 기능 플래그 이벤트 시 훅 트리거.
issues_events Boolean No 이슈 이벤트 시 훅 트리거.
job_events Boolean No job 이벤트 시 훅 트리거.
member_events Boolean No 멤버 이벤트 시 훅 트리거.
merge_requests_events Boolean No 머지 리퀘스트 이벤트 시 훅 트리거.
milestone_events Boolean No 마일스톤 이벤트 시 훅 트리거.
name String No 훅 이름(GitLab 17.1에서 도입).
note_events Boolean No 노트 이벤트 시 훅 트리거.
pipeline_events Boolean No 파이프라인 이벤트 시 훅 트리거.
project_events Boolean No 프로젝트 이벤트 시 훅 트리거.
push_events Boolean No 푸시 이벤트 시 훅 트리거.
push_events_branch_filter String No 일치하는 브랜치에 대한 푸시 이벤트 시에만 훅 트리거.
releases_events Boolean No 릴리즈 이벤트 시 훅 트리거.
resource_access_token_events Boolean No 프로젝트 액세스 토큰 만료 이벤트 시 훅 트리거.
signing_token String No webhook-signature 헤더 계산에 사용되는 HMAC 서명 토큰. 32바이트 키를 인코딩하는 whsec_ 형식이어야 합니다. 응답에 반환되지 않음.
subgroup_events Boolean No 하위 그룹 이벤트 시 훅 트리거.
tag_push_events Boolean No 태그 푸시 이벤트 시 훅 트리거.
token String No 수신한 페이로드를 검증하기 위한 시크릿 토큰. 응답에 반환되지 않음.
wiki_page_events Boolean No 위키 페이지 이벤트 시 훅 트리거.

예시 요청:

curl --request POST \
  --header "content-type: application/json" \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks" \
  --data '{"url": "https://example.com/hook", "name": "My Hook", "description": "Hook description"}'

예시 응답:

{
  "id": 42,
  "url": "https://example.com/hook",
  "name": "My Hook",
  "description": "Hook description",
  "group_id": 3,
  "push_events": true,
  "push_events_branch_filter": "",
  "branch_filter_strategy": "wildcard",
  "issues_events": true,
  "confidential_issues_events": true,
  "merge_requests_events": true,
  "tag_push_events": true,
  "note_events": true,
  "confidential_note_events": true,
  "job_events": true,
  "pipeline_events": true,
  "wiki_page_events": true,
  "deployment_events": true,
  "feature_flag_events": true,
  "releases_events": true,
  "milestone_events": true,
  "subgroup_events": true,
  "member_events": true,
  "project_events": true,
  "enable_ssl_verification": true,
  "repository_update_events": false,
  "alert_status": "executable",
  "disabled_until": null,
  "url_variables": [ ],
  "created_at": "2012-10-12T17:04:47Z",
  "resource_access_token_events": true,
  "custom_webhook_template": "{\"event\":\"{{object_kind}}\"}",
  "token_present": false,
  "signing_token_present": false
}

그룹 훅 수정#

히스토리
  • namedescription 속성이 GitLab 17.1에서 도입됨.
  • signing_token 속성이 GitLab 19.0에서 webhook_signing_token이라는 이름의 기능 플래그와 함께 도입됨. 기본적으로 활성화됨.

  • 기능 플래그 webhook_signing_token이 GitLab 19.1에서 제거됨.

지정한 그룹의 그룹 훅을 수정합니다.

PUT /groups/:id/hooks/:hook_id

지원되는 속성:

Attribute Type Required Description
hook_id Integer Yes 그룹 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.
url String Yes 훅 URL.
branch_filter_strategy String No 브랜치별 푸시 이벤트 필터링. 가능한 값은 wildcard(기본값), regex, all_branches.
confidential_issues_events Boolean No 기밀 이슈 이벤트 시 훅 트리거.
confidential_note_events Boolean No 기밀 노트 이벤트 시 훅 트리거.
custom_headers Array No 훅의 커스텀 헤더.
custom_webhook_template String No 훅의 커스텀 웹훅 템플릿.
deployment_events Boolean No 배포 이벤트 시 훅 트리거.
description String No 훅 설명.
enable_ssl_verification Boolean No 훅 트리거 시 SSL 검증 수행.
feature_flag_events Boolean No 기능 플래그 이벤트 시 훅 트리거.
issues_events Boolean No 이슈 이벤트 시 훅 트리거.
job_events Boolean No job 이벤트 시 훅 트리거.
member_events Boolean No 멤버 이벤트 시 훅 트리거.
merge_requests_events Boolean No 머지 리퀘스트 이벤트 시 훅 트리거.
milestone_events Boolean No 마일스톤 이벤트 시 훅 트리거.
name String No 훅 이름.
note_events Boolean No 노트 이벤트 시 훅 트리거.
pipeline_events Boolean No 파이프라인 이벤트 시 훅 트리거.
project_events Boolean No 프로젝트 이벤트 시 훅 트리거.
push_events Boolean No 푸시 이벤트 시 훅 트리거.
push_events_branch_filter String No 일치하는 브랜치에 대한 푸시 이벤트 시에만 훅 트리거.
releases_events Boolean No 릴리즈 이벤트 시 훅 트리거.
resource_access_token_events Boolean No 프로젝트 액세스 토큰 만료 이벤트 시 훅 트리거.
service_access_tokens_expiration_enforced Boolean No 서비스 계정 액세스 토큰에 만료일 필수 지정.
signing_token String No webhook-signature 헤더 계산에 사용되는 HMAC 서명 토큰. 32바이트 키를 인코딩하는 whsec_ 형식이어야 합니다. 응답에 반환되지 않음.
subgroup_events Boolean No 하위 그룹 이벤트 시 훅 트리거.
tag_push_events Boolean No 태그 푸시 이벤트 시 훅 트리거.
token String No 수신한 페이로드를 검증하기 위한 시크릿 토큰. 응답에 반환되지 않음. 웹훅 URL을 변경하면 시크릿 토큰이 초기화되어 유지되지 않습니다.
wiki_page_events Boolean No 위키 페이지 이벤트 시 훅 트리거.

예시 요청:

curl --request POST \
  --header "content-type: application/json" \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1" \
  --data '{"url": "https://example.com/hook", "name": "New hook name", "description": "Changed hook description"}'

예시 응답:

{
  "id": 1,
  "url": "https://example.com/hook",
  "name": "New hook name",
  "description": "Changed hook description",
  "group_id": 3,
  "push_events": true,
  "push_events_branch_filter": "",
  "branch_filter_strategy": "wildcard",
  "issues_events": true,
  "confidential_issues_events": true,
  "merge_requests_events": true,
  "tag_push_events": true,
  "note_events": true,
  "confidential_note_events": true,
  "job_events": true,
  "pipeline_events": true,
  "wiki_page_events": true,
  "deployment_events": true,
  "feature_flag_events": true,
  "releases_events": true,
  "milestone_events": true,
  "subgroup_events": true,
  "member_events": true,
  "project_events": true,
  "enable_ssl_verification": true,
  "repository_update_events": false,
  "alert_status": "executable",
  "disabled_until": null,
  "url_variables": [ ],
  "created_at": "2012-10-12T17:04:47Z",
  "resource_access_token_events": true,
  "custom_webhook_template": "{\"event\":\"{{object_kind}}\"}",
  "custom_headers": [
    {
      "key": "Authorization"
    }
  ],
  "token_present": false,
  "signing_token_present": false
}

그룹 훅 삭제#

지정한 그룹 훅을 삭제합니다. 이 메서드는 멱등성을 가지며 여러 번 호출할 수 있습니다. 훅이 존재하거나 존재하지 않을 수 있습니다.

DELETE /groups/:id/hooks/:hook_id

지원되는 속성:

Attribute Type Required Description
hook_id Integer Yes 그룹 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.

예시 요청:

curl --request DELETE \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1"

성공 시 메시지가 반환되지 않습니다.

테스트 그룹 훅 트리거#

히스토리
  • 특별 속도 제한이 GitLab 17.1에서 web_hook_test_api_endpoint_rate_limit라는 이름의 기능 플래그와 함께 도입됨. 기본적으로 활성화됨.

지정한 그룹에 대한 테스트 훅을 트리거합니다.

이 엔드포인트는 각 그룹 및 인증된 사용자당 분당 5개 요청의 속도 제한이 있습니다. GitLab Self-Managed 및 GitLab Dedicated에서 이 제한을 비활성화하려면 관리자가 web_hook_test_api_endpoint_rate_limit라는 이름의 기능 플래그를 비활성화할 수 있습니다.

POST /groups/:id/hooks/:hook_id/test/:trigger
Attribute Type Required Description
hook_id Integer Yes 그룹 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.
trigger String Yes push_events, tag_push_events, issues_events, confidential_issues_events, note_events, merge_requests_events, job_events, pipeline_events, wiki_page_events, releases_events, milestone_events, emoji_events, resource_access_token_events 중 하나.

예시 요청:

curl --request POST \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1/test/push_events"

예시 응답:

{"message":"201 Created"}

커스텀 헤더 수정#

히스토리

지정한 그룹 훅의 커스텀 헤더를 수정합니다.

PUT /groups/:id/hooks/:hook_id/custom_headers/:key

지원되는 속성:

Attribute Type Required Description
hook_id Integer Yes 그룹 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.
key String Yes 커스텀 헤더의 키.
value String Yes 커스텀 헤더의 값.

예시 요청:

curl --request PUT \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1/custom_headers/header_key?value='header_value'"

성공 시 메시지가 반환되지 않습니다.

커스텀 헤더 삭제#

히스토리

커스텀 헤더를 삭제합니다.

DELETE /groups/:id/hooks/:hook_id/custom_headers/:key

지원되는 속성:

Attribute Type Required Description
hook_id Integer Yes 그룹 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.
key String Yes 커스텀 헤더의 키.

예시 요청:

curl --request DELETE \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1/custom_headers/header_key"

성공 시 메시지가 반환되지 않습니다.

URL 변수 수정#

히스토리

지정한 그룹 훅의 URL 변수를 수정합니다.

PUT /groups/:id/hooks/:hook_id/url_variables/:key

지원되는 속성:

Attribute Type Required Description
hook_id Integer Yes 그룹 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.
key String Yes URL 변수의 키.
value String Yes URL 변수의 값.

예시 요청:

curl --request PUT \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1/url_variables/my_key?value='my_key_value'"

성공 시 메시지가 반환되지 않습니다.

URL 변수 삭제#

지정한 그룹 훅의 URL 변수를 삭제합니다.

DELETE /groups/:id/hooks/:hook_id/url_variables/:key

지원되는 속성:

Attribute Type Required Description
hook_id Integer Yes 그룹 훅의 ID.
id Integer or string Yes 그룹의 ID 또는 URL 인코딩된 경로.
key String Yes URL 변수의 키.

예시 요청:

curl --request DELETE \
  --header "PRIVATE-TOKEN: <your_access_token>" \
  --url "https://gitlab.example.com/api/v4/groups/3/hooks/1/url_variables/my_key"