You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何用GitHub REST API列出企业账户所属组织及用户

使用GitHub REST API操作企业账户资源

列出企业账户所属的组织

调用GET /enterprises/{enterprise}/orgs接口,将{enterprise}替换为你的企业账户slug(即企业账户的短名称)。

请求示例(curl):

curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/enterprises/ENTERPRISE/orgs

列出企业账户下的所有用户

调用GET /enterprises/{enterprise}/users接口,同样将{enterprise}替换为你的企业账户slug。

请求示例(curl):

curl -L \
  -H "Accept: application/vnd.github+json" \
  -H "Authorization: Bearer <YOUR-TOKEN>" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  https://api.github.com/enterprises/ENTERPRISE/users
  • 操作前提:需拥有企业账户管理员权限,且访问令牌需包含admin:enterprise或对应权限范围
  • 分页支持:可通过page和per_page参数控制返回结果的分页与单页数量

内容的提问来源于stack exchange,提问作者paradox

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.04 00:22:03