에이전트 병합을 위한 REST API 엔드포인트
REST API를 사용하여 풀 리퀘스트에 대한 Agent Merge를 가져오고, 업데이트하고, 사용하지 않도록 설정합니다.
Get Agent Merge configuration for a pull request
Gets the Agent Merge configuration for a pull request.
You must have write access to the repository.
OAuth app tokens and personal access tokens (classic) need the repo scope for private or internal repositories, or the public_repo scope for public repositories.
"Get Agent Merge configuration for a pull request"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
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. The name is not case sensitive. |
pull_number integer 필수The number that identifies the pull request. |
"Get Agent Merge configuration for a pull request"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | Stored configuration retrieved successfully |
401 | Authentication required |
403 | Caller is not permitted to read this enrollment |
404 | Resource or enrollment is absent, enrollment is disabled, or access is masked as not found |
422 | Invalid request parameters |
429 | Rate limit exceeded |
503 | Enrollment storage or an authorization dependency is unavailable |
"Get Agent Merge configuration for a pull request"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, 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/agents/repos/OWNER/REPO/pulls/PULL_NUMBER/agent-mergeAgent Merge configuration for an enrolled pull request
Status: 200{
"allowed_actions": [
"fix_ci",
"resolve_merge_conflicts"
],
"created_at": "2026-09-09T12:00:00Z",
"updated_at": "2026-09-09T12:00:00Z",
"user": {
"id": 9876
}
}Update Agent Merge configuration for a pull request
Updates the Agent Merge configuration for a pull request, enabling Agent Merge or changing the allowed actions that Copilot is allowed to take on the pull request.
If Agent Merge is currently enabled for the pull request, only the user who most recently enabled it may change its allowed actions.
If enrollment eligibility cannot be determined, the operation returns 503.
This endpoint is only available to users with a Copilot subscription, excluding Copilot Free users. You must have write access to the repository, the pull request must not be from a fork or part of a stack, and the repository must have the "Allow automations" setting enabled.
OAuth app tokens and personal access tokens (classic) need the repo scope for private or internal repositories, or the public_repo scope for public repositories.
"Update Agent Merge configuration for a pull request"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
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. The name is not case sensitive. |
pull_number integer 필수The number that identifies the pull request. |
| 이름, 유형, 설명 |
|---|
allowed_actions array of strings 필수The set of actions that Copilot may perform on the pull request.
Supported values are: |
"Update Agent Merge configuration for a pull request"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
200 | Existing Agent Merge enrollment updated |
201 | Pull request enrolled for Agent Merge |
400 | Malformed JSON request body |
401 | Authentication required |
403 | Caller lacks the permissions or eligibility to enroll the pull request for Agent Merge |
404 | Resource is absent or masked as not found |
409 | Enrollment changed during the write; no replacement was committed |
422 | Ineligible pull request, invalid action selection, or unknown body properties |
429 | Rate limit exceeded |
503 | Enrollment storage or an authorization dependency is unavailable, or eligibility is unknown |
"Update Agent Merge configuration for a pull request"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/agents/repos/OWNER/REPO/pulls/PULL_NUMBER/agent-merge \
-d '{"allowed_actions":["fix_ci"]}'Pull request enrolled for Agent Merge
Status: 201{
"allowed_actions": [
"fix_ci"
],
"created_at": "2026-09-09T12:00:00Z",
"updated_at": "2026-09-09T12:00:00Z",
"user": {
"id": 9876
}
}Disable Agent Merge for a pull request
Disables Agent Merge for a pull request.
You must have write access to the repository. Disabling does not require enrollment eligibility: your Copilot subscription, coding-agent and Automations policies, the Agent Merge execution flag, pull request state, stack membership, and repository archive state do not prevent cleanup. Authentication, token repository selection, and "Agent tasks" write permission remain required.
OAuth app tokens and personal access tokens (classic) need the repo scope for private or internal repositories, or the public_repo scope for public repositories.
"Disable Agent Merge for a pull request"에 대한 매개 변수
| 이름, 유형, 설명 |
|---|
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. The name is not case sensitive. |
pull_number integer 필수The number that identifies the pull request. |
"Disable Agent Merge for a pull request"에 대한 HTTP 응답 상태 코드
| 상태 코드 | 설명 |
|---|---|
204 | Agent Merge successfully disabled for the pull request |
401 | Authentication required |
403 | Caller lacks write permission |
404 | Resource or enrollment is absent or masked as not found |
409 | Enrollment changed during the write; no replacement was committed |
422 | Invalid request parameters |
429 | Rate limit exceeded |
503 | Enrollment storage, authorization, or required publication is unavailable |
"Disable Agent Merge for a pull request"에 대한 코드 샘플
GitHub에 GHE.com으로 액세스하는 경우, api.github.com를 api.SUBDOMAIN.ghe.com에 해당하는 귀하의 엔터프라이즈 전용 하위 도메인으로 교체하십시오.
요청 예제
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer <YOUR-TOKEN>" \
-H "X-GitHub-Api-Version: 2026-03-10" \
https://api.github.com/agents/repos/OWNER/REPO/pulls/PULL_NUMBER/agent-mergeAgent Merge successfully disabled for the pull request
Status: 204