---
title: "Update Agent Merge configuration for a pull request"
method: PUT
path: "/agents/repos/{owner}/{repo}/pulls/{pull_number}/agent-merge"
tags: ["agent-merge"]
---

# Update Agent Merge configuration for a pull request

`PUT /agents/repos/{owner}/{repo}/pulls/{pull_number}/agent-merge`

## Request

- Base URL: `https://api.github.com`
- URL: `https://api.github.com/agents/repos/{owner}/{repo}/pulls/{pull_number}/agent-merge`
- Auth: none declared

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.

## Path parameters

- `owner` string, required
- `repo` string, required
- `pull_number` integer, required

## Request body

- object: The Agent Merge enrollment configuration
  - `allowed_actions` string[], required: The set of actions that Copilot may perform on the pull request.

## Response `200`

Existing Agent Merge enrollment updated

- object: The Agent Merge configuration for an enrolled pull request.
  - `allowed_actions` string[], required: The set of actions which Copilot may perform on the pull request.
  - `created_at` string, date-time, required: Timestamp when the pull request was enrolled for Agent Merge.
  - `updated_at` string, date-time, required: Timestamp when the Agent Merge enrollment was last updated.
  - `user` object, required: The user who most recently enabled Agent Merge for the pull request
    - `id` integer, required: The unique identifier of the user

## Other responses

- `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

## Changes

- **2026-10-28** `40ffa0de0018`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/github/apis/enterprise-cloud/changes/agents/repos/:owner/:repo/pulls/:pull_number/agent-merge/put.md)

---

[API](https://skmtc.dev/github/apis/enterprise-cloud.md) - [All operations](https://skmtc.dev/github/apis/enterprise-cloud/llms.txt) - [OpenAPI document](https://skmtc.dev/github/apis/enterprise-cloud/revisions/3b55ce443f5c?raw)
