---
title: "Set selected repositories for Copilot cloud agent in an organization"
method: PUT
path: "/orgs/{org}/copilot/coding-agent/permissions/repositories"
tags: ["copilot"]
---

# Set selected repositories for Copilot cloud agent in an organization

`PUT /orgs/{org}/copilot/coding-agent/permissions/repositories`

> [!NOTE]
> This endpoint is in public preview and is subject to change.

Replaces the list of selected repositories that are enabled for Copilot cloud
agent in an organization. This method can only be called when the cloud agent
repository policy is set to `selected`.

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

## Path parameters

- `org` string, required

## Request body

- object
  - `selected_repository_ids` integer[], required — List of repository IDs to enable for Copilot cloud agent.

## Response `204`

No Content

## Other responses

- `401` — Requires authentication
- `403` — Forbidden
- `404` — Resource not found
- `409` — Conflict
- `422` — Validation failed, or the endpoint has been spammed.
- `500` — Internal Error

---

[API](https://skmtc.net/github/apis/ghec.md) · [All operations](https://skmtc.net/github/apis/ghec/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/ghec/revisions/daeba3129b5f/schema)
