---
title: "Update a code scanning default setup configuration"
method: PATCH
path: "/repos/{owner}/{repo}/code-scanning/default-setup"
tags: ["code-scanning"]
---

# Update a code scanning default setup configuration

`PATCH /repos/{owner}/{repo}/code-scanning/default-setup`

Updates a code scanning default setup configuration.

OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories.

## Path parameters

- `owner` string, required
- `repo` string, required

## Request body

- CodeScanningDefaultSetupUpdate — Configuration for code scanning default setup.
  - `state` 'configured' | 'not-configured' — The desired state of code scanning default setup.
  - `runner_type` 'standard' | 'labeled' — Runner type to be used.
  - `runner_label` string, nullable — Runner label to be used if the runner type is labeled.
  - `query_suite` 'default' | 'extended' — CodeQL query suite to be used.
  - `threat_model` 'remote' | 'remote_and_local' — Threat model to be used for code scanning analysis. Use `remote` to analyze only network sources and `remote_and_local` to include local sources like filesystem access, command-line arguments, database reads, environment variable and standard input.
  - `languages` string[] — CodeQL languages to be analyzed.

## Response `200`

Response

- EmptyObject — An object without any properties.

## Other responses

- `202` — Response
- `403` — Response if the repository is archived or if GitHub Advanced Security is not enabled for this repository
- `404` — Resource not found
- `409` — Response if there is already a validation run in progress with a different default setup configuration
- `422` — Response if the configuration change cannot be made because the repository is not in the required state
- `503` — Service unavailable

---

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