---
title: "Update code security and analysis features for an enterprise"
method: PATCH
path: "/enterprises/{enterprise}/code_security_and_analysis"
tags: ["enterprise-admin"]
---

# Update code security and analysis features for an enterprise

`PATCH /enterprises/{enterprise}/code_security_and_analysis`

Updates the settings for advanced security, secret scanning, and push protection for new 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

## Request body

- object
  - `dependabot_alerts_enabled_for_new_repositories` boolean — Whether Dependabot alerts are automatically enabled for new repositories. For more information, see "[About Dependabot alerts](https://docs.github.com/enterprise-server@3.8/code-security/dependabot/dependabot-alerts/about-dependabot-alerts)."

## 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-7.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-7/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-7/revisions/5438365412fe/schema)
