apicheats.dev github/llms.txt Raw .md
PUT

PUT /orgs/{org}/code-security/configurations/{configuration_id}/defaults — GitHub API

GitHub token (required); https://api.github.com

GitHub API

Set a code security configuration as a default for an organization

Base URL
https://api.github.com
Auth
Authorization: Bearer <GITHUB_API_KEY>
Last verified
2026-10-20 · upstream hash matched
Actions Try in browser→
Agents: curl -H "Accept: text/markdown" this URL
→ 236 tokens · Vary: Accept

Critical gotchas

GitHub recommends an Accept: application/vnd.github+json header and an explicit X-GitHub-Api-Version header.

Fine-grained tokens only authorize repositories and permissions selected when the token is created.

cURL

curl -X PUT 'https://api.github.com/orgs/example-org/code-security/configurations/10/defaults' \  -H "Authorization: Bearer $GITHUB_TOKEN" \  -H 'Accept: application/vnd.github+json' \  -H 'X-GitHub-Api-Version: 2026-03-10' \  -H 'Content-Type: application/json' \  -d '{}'

Parameters

Name In Type Required Description
org path string Yes The organization name. The name is not case sensitive.
configuration_id path integer Yes The unique identifier of the code security configuration.
default_for_new_repos body string No Specify which types of repository this security configuration should be applied to by default.

Response 200 OK

{
  "default_for_new_repos": "all",
  "configuration": {
    "id": 0,
    "name": "string",
    "target_type": "global",
    "description": "string",
    "advanced_security": "enabled",
    "dependency_graph": "enabled",
    "dependency_graph_autosubmit_action": "enabled",
    "dependency_graph_autosubmit_action_options": {
      "labeled_runners": true
    },
    "dependabot_alerts": "enabled",
    "dependabot_security_updates": "enabled",
    "dependabot_delegated_alert_dismissal": "enabled",
    "code_scanning_options": {
      "allow_advanced": true
    },
    "code_scanning_default_setup": "enabled",
    "code_scanning_default_setup_options": {
      "runner_type": "standard",
      "runner_label": "string"
    },
    "code_scanning_delegated_alert_dismissal": "enabled",
    "secret_scanning": "enabled",
    "secret_scanning_push_protection": "enabled",
    "secret_scanning_delegated_bypass": "enabled",
    "secret_scanning_delegated_bypass_options": {
      "reviewers": [
        {
          "reviewer_id": 0,
          "reviewer_type": "TEAM",
          "mode": "ALWAYS",
          "security_configuration_id": 0
        }
      ]
    },
    "secret_scanning_validity_checks": "enabled",
    "secret_scanning_non_provider_patterns": "enabled",
    "secret_scanning_generic_secrets": "enabled",
    "secret_scanning_delegated_alert_dismissal": "enabled",
    "secret_scanning_extended_metadata": "enabled",
    "private_vulnerability_reporting": "enabled",
    "enforcement": "enforced",
    "url": "https://example.com",
    "html_url": "https://example.com",
    "created_at": "2026-09-03T00:00:00Z",
    "updated_at": "2026-09-03T00:00:00Z"
  }
}
Get a free GitHub API key → sponsored

Affiliate link - we may earn a commission, at no extra cost to you.