> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trellis.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Organization Rule

> Delete an organization rule

Permanently deletes an organization rule.

<Note>
  This endpoint requires admin privileges.
</Note>

<ParamField header="Authorization" type="string" required>
  Bearer token obtained from the authenticate endpoint. The authenticated user must be an admin.
</ParamField>

<ParamField path="rule_id" type="string" required>
  UUID of the rule to delete.
</ParamField>

## Response

<ResponseField name="message" type="string">
  Confirmation message: `"Organization rule deleted successfully"`.
</ResponseField>

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl -X DELETE https://api.trellis.sh/v1/organization-rules/b2c3d4e5-f6a7-8901-bcde-f12345678901 \
    -H "Authorization: Bearer YOUR_TOKEN"
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import requests

  rule_id = "b2c3d4e5-f6a7-8901-bcde-f12345678901"

  response = requests.delete(
      f"https://api.trellis.sh/v1/organization-rules/{rule_id}",
      headers={"Authorization": "Bearer YOUR_TOKEN"},
  )
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const ruleId = "b2c3d4e5-f6a7-8901-bcde-f12345678901";

  await fetch(`https://api.trellis.sh/v1/organization-rules/${ruleId}`, {
    method: "DELETE",
    headers: { Authorization: "Bearer YOUR_TOKEN" },
  });
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "message": "Organization rule deleted successfully"
  }
  ```

  ```json 401 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "detail": "Missing Authorization header"
  }
  ```

  ```json 403 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "detail": "Admin privileges required"
  }
  ```

  ```json 404 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  {
    "detail": "Organization rule not found"
  }
  ```
</ResponseExample>
