알림 설정 API

Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

REST API를 사용하여 알림 설정을 변경합니다.

유효한 알림 수준

알림 수준은 NotificationSetting.level 모델 열거형으로 정의됩니다. 현재 이러한 수준이 인식됩니다:

  • disabled
  • participating
  • watch
  • global
  • mention
  • custom

custom 수준을 사용하면 특정 이메일 이벤트를 제어할 수 있습니다. 사용 가능한 이벤트는 NotificationSetting.email_events에 의해 반환됩니다. 현재 이러한 이벤트가 인식됩니다:

  • new_note
  • new_issue
  • reopen_issue
  • close_issue
  • reassign_issue
  • issue_due
  • new_merge_request
  • push_to_merge_request
  • reopen_merge_request
  • close_merge_request
  • reassign_merge_request
  • merge_merge_request
  • failed_pipeline
  • fixed_pipeline
  • success_pipeline
  • moved_project
  • merge_when_pipeline_succeeds
  • new_epic Ultimate only.

전역 알림 설정

현재 알림 설정 및 이메일 주소를 가져옵니다.

GET /notification_settings
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/notification_settings"

예시 응답:

{
  "level": "participating",
  "notification_email": "admin@example.com"
}

전역 알림 설정 업데이트

현재 알림 설정 및 이메일 주소를 업데이트합니다.

PUT /notification_settings
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/notification_settings?level=watch"
속성 유형 필수 설명
level 문자열 아니요 전역 알림 수준
notification_email 문자열 아니요 알림을 전송할 이메일 주소
new_note 부울 아니요 이 알림을 활성화/비활성화합니다
new_issue 부울 아니요 이 알림을 활성화/비활성화합니다
reopen_issue 부울 아니요 이 알림을 활성화/비활성화합니다

예시 응답:

{
  "level": "watch",
  "notification_email": "admin@example.com"
}

그룹/프로젝트 레벨 알림 설정

현재 그룹 또는 프로젝트 알림 설정을 가져옵니다.

GET /groups/:id/notification_settings
GET /projects/:id/notification_settings
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/notification_settings"
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/8/notification_settings"
속성 유형 필수 설명
id 정수 또는 문자열 그룹 또는 프로젝트의 ID 또는 URL 인코딩된 경로

예시 응답:

{
  "level": "global"
}

그룹/프로젝트 레벨 알림 설정 업데이트

현재 그룹/프로젝트 알림 설정을 업데이트합니다.

PUT /groups/:id/notification_settings
PUT /projects/:id/notification_settings
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/5/notification_settings?level=watch"
curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/8/notification_settings?level=custom&new_note=true"
속성 유형 필수 설명
id 정수 또는 문자열 그룹 또는 프로젝트의 ID 또는 URL 인코딩된 경로
level 문자열 아니요 전역 알림 수준
new_note 부울 아니요 이 알림을 활성화/비활성화합니다

예시 응답:

{
  "level": "watch"
}
{
  "level": "custom",
  "events": {
    "new_note": true,
    "new_issue": false,
    ...
  }
}

GitLab Ultimate 사용자는 전역 및 그룹 수준 알림 설정에 대해 new_epic 매개변수를 볼 수도 있습니다:

{
  "level": "custom",
  "events": {
    "new_note": true,
    "new_issue": false,
    "new_epic": false,
    ...
  }
}