# REST-API-Endpunkte für Copilot Teamanpassungen

Verwenden Sie die REST-API, um Copilot benutzerdefinierte Anpassungen für ein Team zu verwalten.

## Informationen zu Copilot Teamanpassungen

Ein Copilot Anpassungsdokument definiert die Plugins und Plug-In-Marketplaces, die Mitgliedern eines Organisationsteams zur Verfügung stehen. 
GitHub speichert ein Dokument für jedes Team. Sie können das Dokument auf der Registerkarte **Customize Copilot** des Teams oder mit diesen Endpunkten erstellen und verwalten.

Das Anpassungsdokument unterstützt die folgenden Schlüssel der obersten Ebene:

* `pluginAssignments`: Plug-Ins für das Team verfügbar, mit `PLUGIN@MARKETPLACE` als Schlüssel. Jedes Plug-In ist standardmäßig aktiviert.
*               `extraKnownMarketplaces`: Zusätzliche Plug-In-Marketplaces, die für das Team verfügbar sind, nach Marketplace-Namen benannt.

Die unten aufgeführten Anfrage- und Antwortbeispiele zeigen ein Plug-In und seinen Marketplace.

## Erforderliche Zugriffsberechtigungen

Der authentifizierte Benutzer muss ein Organisationsbesitzer oder ein Maintainer des Teams sein. Für ein Unternehmensteam, das der Organisation zugewiesen ist, einschließlich eines, das mit einer Identitätsanbietergruppe synchronisiert wurde, muss der authentifizierte Benutzer ein Organisationsbesitzer sein. Die erforderlichen Scopes und Berechtigungen gelten zusätzlich zu diesen Rollenanforderungen.

| Tokentyp | Anpassungen lesen | Ersetzen oder löschen Sie Anpassungen |
| --- | --- | --- |
| Personal access token (classic) oder OAuth app Token | `read:org` oder `admin:org` Gültigkeitsbereich | `admin:org`-Bereich |
| Fine-grained personal access token oder GitHub App Benutzerzugriffstoken | Organisationsberechtigung „Einstellungen für Copilot Agent“ mit Lesezugriff | Organisationsberechtigung "Copilot-Agent-Einstellungen" mit Schreibzugriff |

## Erstellen und Aktualisieren von Anpassungen

Um das Anpassungsdokument eines Teams zu erstellen, senden Sie das vollständige Dokument als JSON-Anforderungstext an den `PUT` Endpunkt. Umschließen Sie es nicht mit einem weiteren Objekt. Eine erfolgreiche Anforderung gibt `200 OK` mit dem übermittelten Dokument zurück.

Der `PUT` Endpunkt ersetzt das gesamte Dokument. Die Anforderung wird nicht mit vorhandenen Anpassungen zusammengeführt. Jedes Plug-In oder Marketplace, das von der Anforderung weggelassen wird, wird aus dem gespeicherten Dokument entfernt.

So bearbeiten Sie ein vorhandenes Dokument:

1. Rufen Sie das aktuelle Anpassungsdokument des Teams mithilfe des `GET` Endpunkts ab.
1. Bearbeiten Sie das Dokument und behalten Sie dabei jedes Plug-in und jeden Marketplace bei, das bzw. den Sie behalten wollen.
1. Senden Sie das vollständige Dokument an den `PUT` Endpunkt.

Das Lesen eines Dokuments vor dem Ersetzen verhindert keine weitere Bearbeitung zwischen Anfragen.

Der `GET` Endpunkt gibt zurück `404 Not Found` , wenn das Team kein Dokument hat. Ein `404` kann auch bedeuten, dass das Team für den authentifizierten Benutzer nicht zugänglich ist.

Verwenden Sie den `DELETE` Endpunkt, um das Anpassungsdokument des Teams zu entfernen. Es gibt `204 No Content` auch dann zurück, wenn das Dokument nicht vorhanden ist. Dadurch wird das Team nicht gelöscht.

Ungültige Dokumente geben `422 Unprocessable Entity` mit dem Grund zurück. Eine gleichzeitige Bearbeitung kann dazu führen, dass bei einem Schreib- oder Löschvorgang `409 Conflict` zurückgegeben wird.

> [!NOTE]
> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2026-03-10`. Curl examples below omit these standard headers for brevity.

## Get Copilot customizations for a team

```
GET /orgs/{org}/teams/{team_slug}/copilot/customizations
```

Note

This endpoint is in public preview and is subject to change.

Gets the GitHub-managed Copilot customizations of a team.
The authenticated user must be an organization owner or a team maintainer. Teams that keep their
customizations in a repository return 409.
OAuth app tokens and personal access tokens (classic) need the admin:org or read:org scope to use this endpoint.

### Parameters

#### Headers

- **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

- **`org`** (string) (required)
  The organization name. The name is not case sensitive.

- **`team_slug`** (string) (required)
  The slug of the team name.

### HTTP response status codes

- **200** - OK

- **401** - Requires authentication

- **403** - Forbidden

- **404** - Resource not found

- **409** - Conflict

- **422** - Validation failed, or the endpoint has been spammed.

- **500** - Internal Error

- **503** - Service unavailable

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X GET \
  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/copilot/customizations
```

**Response schema (Status: 200):**

* `pluginAssignments`: object, additional properties: object
* `extraKnownMarketplaces`: object, additional properties: object

## Set Copilot customizations for a team

```
PUT /orgs/{org}/teams/{team_slug}/copilot/customizations
```

Note

This endpoint is in public preview and is subject to change.

Replaces the GitHub-managed Copilot customizations of a team, creating them on the first write.
The authenticated user must be an organization owner or a team maintainer. Teams that keep their
customizations in a repository return 409. Documents that fail validation return 422 with the reason.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

### Parameters

#### Headers

- **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

- **`org`** (string) (required)
  The organization name. The name is not case sensitive.

- **`team_slug`** (string) (required)
  The slug of the team name.

#### Body parameters

- **`pluginAssignments`** (object)
  Plugins assigned to the team, keyed by PLUGIN@MARKETPLACE.
  - **`key`** (object)
    A user-defined key to represent an item in pluginAssignments.
    - **`state`** (string)
      The assignment state.
      Can be one of: `defaultEnabled`

- **`extraKnownMarketplaces`** (object)
  Additional plugin marketplaces available to the team, keyed by marketplace name.
  - **`key`** (object)
    A user-defined key to represent an item in extraKnownMarketplaces.

### HTTP response status codes

- **200** - OK

- **401** - Requires authentication

- **403** - Forbidden

- **404** - Resource not found

- **409** - Conflict

- **422** - Validation failed, or the endpoint has been spammed.

- **500** - Internal Error

- **503** - Service unavailable

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X PUT \
  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/copilot/customizations \
  -d '{
  "pluginAssignments": {
    "code-review@acme-marketplace": {
      "state": "defaultEnabled"
    }
  },
  "extraKnownMarketplaces": {
    "acme-marketplace": {
      "source": {
        "source": "github",
        "repo": "acme/copilot-marketplace"
      }
    }
  }
}'
```

**Response schema (Status: 200):**

Same response schema as [Get Copilot customizations for a team](#get-copilot-customizations-for-a-team).

## Delete Copilot customizations for a team

```
DELETE /orgs/{org}/teams/{team_slug}/copilot/customizations
```

Note

This endpoint is in public preview and is subject to change.

Deletes the GitHub-managed Copilot customizations of a team. Deleting customizations that don't exist succeeds.
The authenticated user must be an organization owner or a team maintainer. Teams that keep their
customizations in a repository return 409.
OAuth app tokens and personal access tokens (classic) need the admin:org scope to use this endpoint.

### Parameters

#### Headers

- **`accept`** (string)
  Setting to `application/vnd.github+json` is recommended.

#### Path and query parameters

- **`org`** (string) (required)
  The organization name. The name is not case sensitive.

- **`team_slug`** (string) (required)
  The slug of the team name.

### HTTP response status codes

- **204** - No Content

- **401** - Requires authentication

- **403** - Forbidden

- **404** - Resource not found

- **409** - Conflict

- **422** - Validation failed, or the endpoint has been spammed.

- **500** - Internal Error

- **503** - Service unavailable

### Code examples

#### Example

**Request:**

```curl
curl -L \
  -X DELETE \
  https://api.github.com/orgs/ORG/teams/TEAM_SLUG/copilot/customizations
```

**Response schema (Status: 204):**