REST API endpoints for Copilot cloud agent repository management
Use the REST API to manage repository-level settings for Copilot云代理.
Get Copilot cloud agent configuration for a repository
Note
This endpoint is in public preview and is subject to change.
Gets the Copilot cloud agent configuration for a repository, including MCP server configuration, enabled review tools, Actions workflow approval settings, and firewall configuration.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
“Get Copilot cloud agent configuration for a repository”的细粒度访问令牌
此端点支持以下精细令牌类型:
细粒度令牌必须具有以下权限集:
- "Copilot agent settings" repository permissions (read)
“”Get Copilot cloud agent configuration for a repository 的参数
| 名称, 类型, 说明 |
|---|
accept string Setting to |
| 名称, 类型, 说明 |
|---|
owner string 必须The account owner of the repository. The name is not case sensitive. |
repo string 必须The name of the repository without the |
“Get Copilot cloud agent configuration for a repository”的 HTTP 响应状态代码
| 状态代码 | 说明 |
|---|---|
200 | OK |
401 | Requires authentication |
403 | Forbidden |
404 | Resource not found |
500 | Internal Error |
“Get Copilot cloud agent configuration for a repository”的代码示例
如果你在 GHE.com 上访问 GitHub,请将 api.github.com 替换为企业的专用子域,位于 api.SUBDOMAIN.ghe.com。
请求示例
curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/repos/OWNER/REPO/copilot/cloud-agent/configurationDefault configuration
Status: 200{
"mcp_configuration": null,
"enabled_tools": {
"codeql": true,
"copilot_code_review": true,
"secret_scanning": true,
"dependency_vulnerability_checks": true
},
"require_actions_workflow_approval": true,
"is_firewall_enabled": true,
"is_firewall_recommended_allowlist_enabled": true,
"custom_allowlist": []
}