---
title: "Enable or disable a security feature"
method: POST
path: "/enterprises/{enterprise}/{security_product}/{enablement}"
tags: ["enterprise-admin"]
deprecated: true
---

# Enable or disable a security feature

`POST /enterprises/{enterprise}/{security_product}/{enablement}`

> **Deprecated.**

> [!WARNING]
> **Closing down notice:** The ability to enable or disable a security feature for an enterprise is closing down. Please use [code security configurations](https://docs.github.com/enterprise-cloud@latest/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-09-27-upcoming-replacement-of-enterprise-code-security-enablement-ui-and-apis).

Enables or disables the specified security feature for all repositories in an enterprise.

The authenticated user must be an administrator of 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
- `security_product` 'advanced_security' | 'advanced_security_user_namespace' | 'dependabot_alerts' | 'secret_scanning' | 'secret_scanning_push_protection' | 'secret_scanning_non_provider_patterns', required
- `enablement` 'enable_all' | 'disable_all', required

## Response `204`

Action started

## Other responses

- `404` — Resource not found
- `422` — The action could not be taken due to an in progress enablement, or a policy is preventing enablement

---

[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)
