官方更新 GitHub Changelog Fri, 10 Jul 2026 正文 ok 248 words

REST API 支持查询多用户预算的每位用户消耗状态

英文标题:Per-user states for multi-user budgets in the REST API

GitHub 为 REST API 新增端点,可一次性检索多用户预算中每位用户的消耗进度与分配限额,支持按已用预算百分比过滤、排序及识别个人预算覆盖。这大幅提升了企业监控大型预算的效率,管理员无需自行编写脚本即可快速定位接近或超出限额的用户。该功能面向 GitHub Enterprise Cloud 的企业所有者与计费管理员开放。
打开原文相关 2 · 机会 5
media12.2 KB media26.4 KB

中文

现在,您可以通过单个 REST API 端点检索每位用户在多用户预算中的消耗进度。这使得在大型企业中快速找到谁接近其限额变得更加高效。

此前,您需要为每个用户单独调用一次 API 来检查其消耗情况,而且无法按用户已使用的预算比例进行过滤。审查大预算中的支出速度缓慢,迫使团队自行编写脚本。现在,您可以从一个端点分页遍历所有用户,并直接关注需要留意的人员。

借助此端点,您可以:

  • 以每次一页的方式获取每位用户在多用户预算中的已消耗量及其分配限额。
  • 按每位用户已使用的预算比例进行过滤,从而在一次请求中拉取所有达到或超出其限额某个百分比的人员。
  • 筛选到单个用户,或按每人消耗预算的多少对结果进行排序。
  • 查看用户何时拥有个人预算覆盖,从而更改应用于该用户的限额。

这适用于两种类型的多用户预算:适用于企业中所有用户的通用预算,以及限定到成本中心的按用户预算。

GitHub Enterprise Cloud 上的企业所有者和计费管理员可以针对其企业中的任何多用户预算调用此端点。

要了解更多信息,请参阅 REST API 文档中的获取多用户预算的用户状态。

English / 原文

You can now retrieve every user’s progress against a multi-user budget from a single REST API endpoint. This makes it much faster to find who is close to their limit across a large enterprise.

Previously, you had to make one API call per user to check per-user consumption, and you couldn’t filter by how much of the budget someone had used. Reviewing spend across a large budget was slow and pushed teams to build their own scripts. Now you can page through all users from one endpoint and go straight to the people who need attention.

With this endpoint, you can:

  • Get how much each user has consumed and their allocated limit for a multi-user budget, one page at a time.
  • Filter by how much of the budget each user has used, so you can pull everyone at or above a certain percentage of their limit in one request.
  • Filter to a single user or sort the results by how much of the budget each person has consumed.
  • See when a user has an individual budget override that changes the limit applied to them.

This works for both types of multi-user budget: a universal budget that applies to every user in your enterprise and a per-user budget scoped to a cost center.

Enterprise owners and billing managers on GitHub Enterprise Cloud can call this endpoint for any multi-user budget in their enterprise.

To learn more, see Get user states for a multi-user budget in the REST API documentation.