Skip to main content
이제 REST API의 버전이 지정되었습니다. 자세한 내용은 "API 버전 관리 정보"를 참조하세요.

Copilot 사용자 지정 에이전트에 대한 REST API 엔드포인트

REST API를 사용하여 엔터프라이즈에 대한 코파일��� 사용자 지정 에이전트를 관리합니다.

Get custom agents for an enterprise

Gets the list of all custom agents defined in the /agents/*.md files in the .github-private repository for the enterprise.

If no source repository has been configured, returns null for custom_agents.

Enterprise owners with read access to AI Controls can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

"Get custom agents for an enterprise"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:

  • "Enterprise AI controls" enterprise permissions (read)

"Get custom agents for an enterprise"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
enterprise string Required

The slug version of the enterprise name.

쿼리 매개 변수
속성, 형식, 설명
per_page integer

The number of results per page (max 100). For more information, see "Using pagination in the REST API."

기본값: 30

page integer

The page number of the results to fetch. For more information, see "Using pagination in the REST API."

기본값: 1

"Get custom agents for an enterprise"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

Success

401

Requires authentication

403

Forbidden

404

Not found or source repository not found

500

Internal Error

"Get custom agents for an enterprise"에 대한 코드 샘플

GHE.com에서 GitHub에 액세스하는 경우 api.github.comapi.SUBDOMAIN.ghe.com의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.

요청 예제

get/enterprises/{enterprise}/copilot/custom-agents
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/copilot/custom-agents

Response with custom agents

Status: 200
{ "custom_agents": [ { "name": "Security Reviewer", "file_path": "agents/security_reviewer.md", "url": "https://github.com/my-org/.github-private/blob/main/agents/security_reviewer.md" }, { "name": "Code Documenter", "file_path": "agents/code_documenter.md", "url": "https://github.com/my-org/.github-private/blob/main/agents/code_documenter.md" } ] }

Get the source organization for custom agents in an enterprise

Gets the organization and repository configured as the source for custom agent definitions in an enterprise.

Custom agents are enterprise-defined AI agents stored as markdown files in a special repository. An enterprise admin configures one organization as the "source" and that org must have a repo named .github-private containing agent definitions in /agents/*.md.

Enterprise owners with read access to AI Controls can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

"Get the source organization for custom agents in an enterprise"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:

  • "Enterprise AI controls" enterprise permissions (read)

"Get the source organization for custom agents in an enterprise"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
enterprise string Required

The slug version of the enterprise name.

"Get the source organization for custom agents in an enterprise"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

403

Forbidden

404

Resource not found

"Get the source organization for custom agents in an enterprise"에 대한 코드 샘플

GHE.com에서 GitHub에 액세스하는 경우 api.github.comapi.SUBDOMAIN.ghe.com의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.

요청 예제

get/enterprises/{enterprise}/copilot/custom-agents/source
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/copilot/custom-agents/source

Response

Status: 200
{ "organization": { "id": 1, "login": "octocat-org" }, "repository": { "id": 123, "name": ".github-private", "full_name": "octocat-org/.github-private" } }

Set the source organization for custom agents in an enterprise

Sets an organization as the source for custom agent definitions in the enterprise. The organization must have a .github-private repository containing agent definitions.

By default, this endpoint also creates an enterprise-level ruleset to protect agent definition files (agents/.md and .github/agents/.md). You can opt out of ruleset creation by setting create_ruleset to false.

Enterprise owners with write access to AI Controls can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

"Set the source organization for custom agents in an enterprise"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:

  • "Enterprise AI controls" enterprise permissions (write)

"Set the source organization for custom agents in an enterprise"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
enterprise string Required

The slug version of the enterprise name.

본문 매개 변수
속성, 형식, 설명
organization_id integer Required

The ID of the organization to use as the custom agents source.

create_ruleset boolean

Whether to create a ruleset to protect agent definition files. Defaults to true.

기본값: true

"Set the source organization for custom agents in an enterprise"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

Success

401

Requires authentication

403

Forbidden

404

Resource not found

422

Validation failed

500

Internal Error

"Set the source organization for custom agents in an enterprise"에 대한 코드 샘플

GHE.com에서 GitHub에 액세스하는 경우 api.github.comapi.SUBDOMAIN.ghe.com의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.

요청 예제

put/enterprises/{enterprise}/copilot/custom-agents/source
curl -L \ -X PUT \ -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/copilot/custom-agents/source \ -d '{"organization_id":123,"create_ruleset":false}'

Response without ruleset

Status: 200
{ "organization": { "id": 123, "login": "my-org", "avatar_url": "https://avatars.githubusercontent.com/u/123" }, "repository": { "id": 456, "name": ".github-private", "full_name": "my-org/.github-private" } }

Delete the custom agents source for an enterprise

Removes the custom agents source configuration for the enterprise. This effectively disables custom agents for the enterprise by removing the reference to the source organization's .github-private repository.

Note: This does not delete the .github-private repository or any agent definition files. It only removes the association between the enterprise and the source repository.

Enterprise owners with write access to AI Controls can use this endpoint.

OAuth app tokens and personal access tokens (classic) need the admin:enterprise scope to use this endpoint.

"Delete the custom agents source for an enterprise"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰에는 다음 권한 집합이 있어야 합니다.:

  • "Enterprise AI controls" enterprise permissions (write)

"Delete the custom agents source for an enterprise"에 대한 매개 변수

머리글
속성, 형식, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
속성, 형식, 설명
enterprise string Required

The slug version of the enterprise name.

"Delete the custom agents source for an enterprise"에 대한 HTTP 응답 상태 코드

상태 코드설명
204

No Content - The custom agents source was successfully removed.

403

Forbidden - The user does not have enterprise admin access.

404

Not found - Enterprise not found, feature not enabled, or no custom agents source is configured.

"Delete the custom agents source for an enterprise"에 대한 코드 샘플

GHE.com에서 GitHub에 액세스하는 경우 api.github.comapi.SUBDOMAIN.ghe.com의 엔터프라이즈 전용 하위 도메인으로 바꾸세요.

요청 예제

delete/enterprises/{enterprise}/copilot/custom-agents/source
curl -L \ -X DELETE \ -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/copilot/custom-agents/source

No Content - The custom agents source was successfully removed.

Status: 204