---
title: "Delete the custom agents source for an enterprise"
method: DELETE
path: "/enterprises/{enterprise}/copilot/custom-agents/source"
tags: ["copilot"]
---

# Delete the custom agents source for an enterprise

`DELETE /enterprises/{enterprise}/copilot/custom-agents/source`

Removes the custom agents source configuration for the enterprise.
This effectively disables custom agents and Copilot CLI client settings
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.

## Path parameters

- `enterprise` string, required

## Response `204`

No Content - The custom agents source was successfully removed.

## Other responses

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

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-2.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-2/versions/8ae6d0c8716e/schema)
