GitHub Enterprise Cloud の課金管理者や billing 連携向けに、リソース起点で cost center 所属を引ける REST エンドポイントが追加された。リポジトリ名や login から割当先を逆引きするレポートや監査スクリプト向け。従来は GET /enterprises/{enterprise}/settings/billing/cost-centers で全 cost center と配下リソースを列挙し、対象を探す必要があった。

#エンドポイント

plaintext
GET /enterprises/{enterprise}/settings/billing/cost-centers/memberships

パス {enterprise} は enterprise slug。必須クエリは次の二つ。

  • resource_type: user / repository / organization / team のいずれか
  • name: リソース識別子。user と organization は login または organization 名、repository は owner/repo、team は enterprise team の slug

200 応答では resource(type と identifier)と memberships 配列が返る。各要素の cost_center に id と name が入る。cost center 未割当のリソースでは memberships は空配列(HTTP エラーではない)。400 / 403 / 404 / 500 / 503 も定義されている。

cost center 系 REST では Accept: application/vnd.github+json に加え X-GitHub-Api-Version: 2026-03-10 を付ける例がドキュメントに載る。

#呼び出し権限

  • enterprise owner、billing manager、enterprise にインストールされた GitHub App(enterprise billing の read 権限付き installation access token): enterprise 内の任意リソースを照会可能
  • organization owner、enterprise billing の read を含むカスタムロール: 自分が管理する organization、そこに属する user、閲覧可能な repository、見える enterprise team に限る

#参考文献