---
title: "Bulk delete organization custom patterns"
method: DELETE
path: "/orgs/{org}/secret-scanning/custom-patterns"
tags: ["secret-scanning"]
---

# Bulk delete organization custom patterns

`DELETE /orgs/{org}/secret-scanning/custom-patterns`

Bulk deletes secret scanning custom patterns for an organization.

Personal access tokens (classic) need the `write:org` scope to use this endpoint.

## Path parameters

- `org` string, required

## Request body

- object
  - `patterns` SecretScanningCustomPatternToDelete[], required — The list of custom patterns to delete.
    - `pattern_id` integer, required — The ID of the custom pattern to delete.
    - `custom_pattern_version` string, nullable — The version of the entity. This is used to confirm you're updating the current version of the entity and mitigate unintentionally overriding someone else's update.
  - `post_delete_action` 'delete_alerts' | 'resolve_alerts' — What to do with alerts associated with the deleted patterns. `delete_alerts` permanently removes the alerts. `resolve_alerts` resolves the alerts as "pattern deleted". Defaults to `delete_alerts` when not specified.

## Response `204`

All patterns deleted successfully.

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `404` — Resource not found
- `412` — Precondition Failed

---

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