---
title: "Detach configurations from repositories"
method: DELETE
path: "/orgs/{org}/code-security/configurations/detach"
tags: ["code-security"]
---

# Detach configurations from repositories

`DELETE /orgs/{org}/code-security/configurations/detach`

Detach code security configuration(s) from a set of repositories.
Repositories will retain their settings but will no longer be associated with the configuration.

The authenticated user must be an administrator or security manager for the organization to use this endpoint.

Repositories with active enterprise-enforced attachments are skipped unless the authenticated user can manage the enterprise's code security settings; the rest are detached. Inactive enterprise-enforced attachments, such as failed attachments, are detached. The request still returns `204` if every repository is skipped.

OAuth app tokens and classic PATs require the `write:org` scope. Managing enterprise-enforced configurations also requires `admin:enterprise` and is not supported by fine-grained PATs or GitHub App access tokens.

## Path parameters

- `org` string, required

## Request body

- object
  - `selected_repository_ids` integer[], required — An array of repository IDs to detach from configurations. Up to 250 IDs can be provided.

## Response `204`

A header with no content is returned.

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `404` — Resource not found
- `409` — Conflict

## Changes

- **2026-04-22** `5be00bb327f5` — 1 breaking
  - the request property `selected_repository_ids` became required

[Change history](https://skmtc.dev/github/apis/rest/changes/orgs/:org/code-security/configurations/detach/delete.md)

---

[API](https://skmtc.dev/github/apis/rest.md) · [All operations](https://skmtc.dev/github/apis/rest/llms.txt) · [OpenAPI document](https://skmtc.dev/github/apis/rest/revisions/f2faaeb373ce?raw)
