본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

알림 서비스 API (Notification services)

원문 보기 위키 갱신

알림 서비스 API는 Slack, 웹훅, Amazon EventBridge, Datadog, OpenTelemetry 같은 서비스에 빌드·작업 알림을 보내는 조직 수준 통합을 관리할 수 있게 해줘요.

📘 필요한 권한 이 엔드포인트들은 API 액세스 토큰 범위와 토큰을 소유한 사용자의 충분한 조직 접근 권한을 모두 요구해요.

  • 목록·조회 작업은 read_notification_services 범위가 필요해요.
  • 생성·갱신·삭제·활성화·비활성화 작업은 write_notification_services 범위가 필요해요. 토큰을 소유한 사용자는 조직 관리자여야 해요. 조직 전체에서 Manage Notification Services가 활성화된 경우 다른 조직 멤버도 이 엔드포인트를 사용할 수 있어요.

출처: 문서

본문

알림 서비스 데이터 모델

알림 서비스 엔드포인트는 다음 필드를 가진 객체를 반환해요.

id 알림 서비스의 UUID
graphql_id 알림 서비스의 GraphQL ID, 사용할 수 없으면 null
url 알림 서비스의 정식 API URL
provider 알림 서비스 유형. webhook, aws_event_bridge, open_telemetry_tracing 같은 기계가 읽을 수 있는 id와 표시용 name을 포함해요.
description 사용자가 제공한 알림 서비스 설명
enabled 알림 서비스가 활성 상태인지 여부
scope 서비스가 적용되는 파이프라인을 결정해요. all은 모든 파이프라인, some_projects는 선택된 파이프라인, exclude_projects는 선택된 파이프라인을 제외한 모든 파이프라인, some_teams는 선택된 팀의 파이프라인, some_clusters는 선택된 클러스터의 파이프라인에 적용돼요. some_* 또는 exclude_projects 범위의 경우 scope_uuids가 선택된 파이프라인·팀·클러스터를 식별해요. exclude_projects 범위는 현재 비공개 프리뷰예요.
scope_uuids some_projects 또는 exclude_projects는 파이프라인 UUID, some_teams는 팀 UUID, some_clusters는 클러스터 UUID. scope가 all이거나 exclude_projects가 제외하는 파이프라인이 없으면 비어 있어요.
branch_configuration 브랜치 필터 패턴. 빈 문자열은 모든 브랜치를 의미해요.
build_states 키가 빌드 또는 작업 상태이고 값이 해당 상태가 알림을 트리거하는지 여부를 나타내는 객체
settings 프로바이더별 구성. 설정 및 비밀 처리를 참조하세요.
created_at 알림 서비스가 생성된 시점의 ISO 8601 타임스탬프
created_by 알림 서비스를 생성한 사용자, 사용할 수 없으면 null

예를 들어:

{
  "id": "9f0f9a19-1b88-4e37-98d8-c5a0cebcdb9a",
  "graphql_id": "Tm90aWZpY2F0aW9uU2VydmljZVdlYmhvb2stLS05ZjBmOWExOS0xYjg4LTRlMzctOThkOC1jNWEwY2ViY2RiOWE=",
  "url": "https://api.buildkite.com/v2/organizations/acme-inc/services/9f0f9a19-1b88-4e37-98d8-c5a0cebcdb9a",
  "provider": {
    "id": "webhook",
    "name": "Webhook"
  },
  "description": "Deploy notifications",
  "enabled": true,
  "scope": "all",
  "scope_uuids": [],
  "branch_configuration": "",
  "build_states": {
    "build_passed": false,
    "build_fixed": false,
    "build_failed": true,
    "build_blocked": false,
    "build_canceled": false,
    "build_failing": false,
    "job_activated": false
  },
  "settings": {
    "url": "https://example.com/buildkite-webhook",
    "version": 3,
    "token": "xxx-yyy-zzz",
    "token_mode": "token",
    "events": ["build.finished"],
    "tls_verify": true,
    "cluster_queue_ids": []
  },
  "created_at": "2026-07-01T10:00:00.000Z",
  "created_by": {
    "id": "3d3c3bf0-7d58-4afe-8fe7-b3017d5504de",
    "graphql_id": "VXNlci0tLTNkM2MzYmYwLTdkNTgtNGFmZS04ZmU3LWIzMDE3ZDU1MDRkZQ==",
    "name": "Sam Kim",
    "email": "sam@example.com",
    "avatar_url": "https://www.gravatar.com/avatar/example",
    "created_at": "2025-01-01T00:00:00.000Z"
  }
}

설정 및 비밀 처리

settings 객체는 프로바이더에 따라 달라져요. 비밀 처리는 Buildkite 인터페이스와 동일해요.

  • 웹훅 token 값은 호출자가 웹훅 토큰이나 HMAC 서명을 검증할 수 있도록 전체가 반환돼요.
  • Datadog api_key나 Amazon EventBridge aws_account_id 같은 마스킹된 필드는 마지막 문자만 표시돼요.
  • access_token과 refresh_token 같은 OAuth 자격 증명은 생략돼요.
  • Slack 수신 웹훅 URL과 암호화된 OpenTelemetry 헤더는 생략돼요.

서비스를 갱신할 때 마스킹된 값을 그대로 다시 보내면 저장된 비밀을 유지해요. 새 평문 값을 보내면 교체돼요.

알림 서비스 목록 조회

알림 서비스를 가장 오래된 순에서 최신순으로 커서 페이지네이션된 목록으로 반환해요.

curl -H "Authorization: Bearer ***" \
  -X GET "https://api.buildkite.com/v2/organizations/{org.slug}/services?per_page=30"

응답은 items에 알림 서비스 객체를, links에 페이지네이션 URL을 포함해요.

{
  "items": [
    {
      "id": "9f0f9a19-1b88-4e37-98d8-c5a0cebcdb9a",
      "graphql_id": null,
      "url": "https://api.buildkite.com/v2/organizations/acme-inc/services/9f0f9a19-1b88-4e37-98d8-c5a0cebcdb9a",
      "provider": {
        "id": "datadog_pipeline_visibility",
        "name": "Datadog Pipeline Visibility"
      },
      "description": "Pipeline visibility",
      "enabled": true,
      "scope": "all",
      "scope_uuids": [],
      "branch_configuration": "",
      "build_states": {
        "build_passed": true,
        "build_fixed": true,
        "build_failed": true,
        "build_blocked": false,
        "build_canceled": false,
        "build_failing": false,
        "job_activated": false
      },
      "settings": {
        "api_key": "XXXXXXXXXXXXcdef",
        "datadog_site": "datadoghq.com",
        "datadog_tags": null
      },
      "created_at": "2026-07-01T10:00:00.000Z",
      "created_by": null
    }
  ],
  "links": {
    "self": "https://api.buildkite.com/v2/organizations/acme-inc/services?per_page=30",
    "next": "https://api.buildkite.com/v2/organizations/acme-inc/services?after=CURSOR&per_page=30"
  }
}

선택 쿼리 문자열 매개변수:

per_page 페이지당 결과 수. 기본값: 30 최대값: 100
after 이 커서 이후의 결과를 반환해요. before와 함께 사용할 수 없어요.
before 이 커서 이전의 결과를 반환해요. after와 함께 사용할 수 없어요.

필수 범위: read_notification_services

성공 응답: 200 OK

알림 서비스 조회

UUID로 알림 서비스를 반환해요.

curl -H "Authorization: Bearer ***" \
  -X GET "https://api.buildkite.com/v2/organizations/{org.slug}/services/{uuid}"

필수 범위: read_notification_services

성공 응답: 200 OK

오류 응답: 조직에서 해당 UUID로 알림 서비스를 찾을 수 없으면 404 Not Found.

알림 서비스 생성

알림 서비스를 생성해요. OAuth로 관리되는 slack_workspace 및 linear 서비스는 먼저 Buildkite 인터페이스로 연결해야 하지만, 이후에는 API로 조회·갱신·삭제·활성화·비활성화할 수 있어요.

curl -H "Authorization: Bearer ***" \
  -H "Content-Type: application/json" \
  -X POST "https://api.buildkite.com/v2/organizations/{org.slug}/services" \
  -d '{
    "provider": "webhook",
    "description": "Deploy notifications",
    "settings": {
      "url": "https://example.com/buildkite-webhook",
      "token": "xxx-yyy-zzz",
      "events": ["build.finished"]
    },
    "build_states": {
      "build_failed": true
    }
  }'

요청 본문 속성:

provider 필수. webhook, aws_event_bridge, open_telemetry_tracing 같은 기계가 읽을 수 있는 알림 서비스 유형. 프로바이더를 참조하세요.
description 사용자가 제공한 알림 서비스 설명
branch_configuration 브랜치 필터 패턴. 예: main feature/*. 빈 문자열은 모든 브랜치를 의미해요.
scope 서비스가 적용되는 파이프라인을 결정해요. all은 모든 파이프라인, some_projects는 선택된 파이프라인, exclude_projects는 선택된 파이프라인을 제외한 모든 파이프라인, some_teams는 선택된 팀의 파이프라인, some_clusters는 선택된 클러스터의 파이프라인에 적용돼요. some_* 또는 exclude_projects 범위의 경우 scope_uuids가 선택된 파이프라인·팀·클러스터를 식별해요. 기본값은 all이에요. exclude_projects 범위는 현재 비공개 프리뷰예요.
scope_uuids some_projects 또는 exclude_projects는 파이프라인 UUID, some_teams는 팀 UUID, some_clusters는 클러스터 UUID. scope가 all이거나 exclude_projects가 제외하는 파이프라인이 없으면 생략해요.
build_states 키가 빌드 또는 작업 상태이고 불리언 값이 해당 상태가 알림을 트리거하는지 여부를 나타내는 객체. 지원 키는 build_passed, build_fixed, build_failed, build_blocked, build_canceled, build_failing, job_activated예요.
settings 프로바이더별 구성. 프로바이더를 참조하세요.

필수 범위: write_notification_services

성공 응답: 201 Created

오류 응답: 요청에 유효하지 않거나, 사용할 수 없거나, 알 수 없거나, 읽기 전용 필드가 포함된 경우 422 Unprocessable Entity.

프로바이더

REST API로 생성할 수 있는 프로바이더는 다음과 같아요.

webhook 설정: url(필수), token, token_mode(token 또는 signature), version, events, tls_verify, cluster_queue_ids. cluster_queue_ids는 작업 이벤트(job.scheduled, job.started, job.finished, job.activated, job.promised_exit_status)를 해당 큐 ID가 목록에 있는 작업으로 제한해요. 빈 목록(기본값)은 모든 큐의 작업 이벤트를 전달해요. 다른 이벤트 유형은 큐로 필터링되지 않아요. 각 ID는 조직의 큐에 속해야 하지만, 이후 삭제된 큐도 수락되므로 기존 필터의 조회-갱신 왕복이 실패하지 않아요. 다른 조직의 큐 ID는 422 오류로 거부돼요.
slack Slack 또는 Slack 호환 수신 웹훅. 설정: url(필수)과 theme(text 또는 emoji).
aws_event_bridge 설정: aws_region(필수), aws_account_id(필수, 12자리 문자열), 조직에서 사용 가능할 때 include_build_meta_data.
datadog_pipeline_visibility 설정: api_key(필수), datadog_site, datadog_tags.
open_telemetry_tracing 설정: endpoint(필수), service_name, headers, resource_attributes, 조직에서 사용 가능할 때 tracestate. 맵 값은 문자열이어야 해요.
event_log_api 조직에서 활성화된 경우에만 사용 가능. 설정: events.

알림 서비스 갱신

요청에 있는 필드만 갱신해요. 생략된 최상위 필드와 설정은 변경되지 않아요.

curl -H "Authorization: Bearer ***" \
  -H "Content-Type: application/json" \
  -X PATCH "https://api.buildkite.com/v2/organizations/{org.slug}/services/{uuid}" \
  -d '{
    "description": "Production deploy notifications",
    "scope": "some_projects",
    "scope_uuids": ["16f3b56f-4934-4546-923c-287859851332"],
    "build_states": {
      "build_failed": true,
      "build_fixed": true
    }
  }'

요청은 생성과 동일한 선택 속성을 받아요. provider를 제공하면 기존 프로바이더와 일치해야 해요. 서비스의 프로바이더는 변경할 수 없기 때문이에요.

일부 설정에는 추가 갱신 제한이 있어요.

  • Amazon EventBridge aws_region과 aws_account_id는 생성 전용이에요.
  • 웹훅은 최신 페이로드 version으로 업그레이드할 수 있지만, 다운그레이드할 수는 없어요.
  • OAuth 자격 증명과 프로바이더가 관리하는 메타데이터는 변경할 수 없어요.
  • Buildkite 인터페이스로 연결된 Slack 웹훅 URL은 변경할 수 없어요.

조회 응답의 제한되거나 마스킹된 값을 변경 없이 다시 보내는 것은 허용되므로, 조회-갱신 왕복이 비밀을 덮어쓰지 않아요.

필수 범위: write_notification_services

성공 응답: 200 OK

오류 응답: 알림 서비스를 찾을 수 없으면 404 Not Found, 갱신이 유효하지 않으면 422 Unprocessable Entity.

알림 서비스 삭제

알림 서비스를 삭제해요.

curl -H "Authorization: Bearer ***" \
  -X DELETE "https://api.buildkite.com/v2/organizations/{org.slug}/services/{uuid}"

필수 범위: write_notification_services

성공 응답: 204 No Content

오류 응답: 알림 서비스를 찾을 수 없으면 404 Not Found, Buildkite가 프로바이더 구성을 제거할 수 없으면 422 Unprocessable Entity.

알림 서비스 활성화

알림 서비스를 활성화하고 이전의 비활성·손상 상태를 지워요. 응답에는 갱신된 알림 서비스 객체가 포함돼요.

curl -H "Authorization: Bearer ***" \
  -X PUT "https://api.buildkite.com/v2/organizations/{org.slug}/services/{uuid}/enable"

필수 범위: write_notification_services

성공 응답: 200 OK

오류 응답: 알림 서비스를 찾을 수 없으면 404 Not Found.

알림 서비스 비활성화

알림 서비스를 비활성화해요. 응답에는 갱신된 알림 서비스 객체가 포함돼요.

curl -H "Authorization: Bearer ***" \
  -X PUT "https://api.buildkite.com/v2/organizations/{org.slug}/services/{uuid}/disable"

필수 범위: write_notification_services

성공 응답: 200 OK

오류 응답: 알림 서비스를 찾을 수 없으면 404 Not Found.

더 알아보기 (Learn more)