---
title: "Attach an enterprise configuration to repositories"
method: POST
path: "/enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach"
tags: ["code-security"]
---

# Attach an enterprise configuration to repositories

`POST /enterprises/{enterprise}/code-security/configurations/{configuration_id}/attach`

Attaches an enterprise code security configuration to repositories. If the repositories specified are already attached to a configuration, they will be re-attached to the provided configuration.

If insufficient GHAS licenses are available to attach the configuration to a repository, only free features will be enabled.

The authenticated user must be an administrator for the enterprise to 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
- `configuration_id` integer, required

## Request body

- object
  - `scope` 'all' | 'all_without_configurations', required — The type of repositories to attach the configuration to.

## Response `202`

Accepted

- object

## Other responses

- `403` — Forbidden
- `404` — Resource not found
- `409` — Conflict

---

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