---
title: "Update a custom rule set (rules, if given, replace the full list)"
method: PATCH
path: "/api/v1/rule-sets/{slug}"
tags: ["Rule sets"]
---

# Update a custom rule set (rules, if given, replace the full list)

`PATCH /api/v1/rule-sets/{slug}`

## Request

- Base URL: `https://overwing.ai`
- URL: `https://overwing.ai/api/v1/rule-sets/{slug}`
- Auth: HTTP bearer

## Request body

- RuleSetUpdate
  - `name` string
  - `description` string, nullable
  - `is_active` boolean
  - `rules` Rule[]
    - `id` string, uuid
    - `name` string, required
    - `description` string, nullable
    - `question_type` 'choice' | 'score' | 'noul', required
    - `question_config` union, required
      - object
        - `options` string[], required
        - `instructions` string, required
      - object
        - `levels` string[], required: Ordered from lowest to highest
        - `instructions` string, required
      - object
        - `question` string, required: A yes/no question
    - `fail_condition` union, required
      - object
        - `failOn` string[], required: Options that fail
      - object
        - `failOn` boolean, required
      - object
        - `failAbove` number, required: Fail when the score is at or above this level index
    - `review_condition` object, nullable
      - `confidenceBelow` number
    - `action` 'block' | 'redact' | 'review': What a caller should do when this rule fails. Echoed on every result and folded into recommended_action.
    - `weight` number
    - `sort_order` integer
    - `is_active` boolean

## Response `200`

Updated

- RuleSet
  - `id` string, uuid
  - `name` string
  - `slug` string
  - `description` string, nullable
  - `is_system_prebuilt` boolean
  - `is_active` boolean
  - `created_at` string, date-time
  - `rules` Rule[]
    - `id` string, uuid
    - `name` string, required
    - `description` string, nullable
    - `question_type` 'choice' | 'score' | 'noul', required
    - `question_config` union, required
      - object
        - `options` string[], required
        - `instructions` string, required
      - object
        - `levels` string[], required: Ordered from lowest to highest
        - `instructions` string, required
      - object
        - `question` string, required: A yes/no question
    - `fail_condition` union, required
      - object
        - `failOn` string[], required: Options that fail
      - object
        - `failOn` boolean, required
      - object
        - `failAbove` number, required: Fail when the score is at or above this level index
    - `review_condition` object, nullable
      - `confidenceBelow` number
    - `action` 'block' | 'redact' | 'review': What a caller should do when this rule fails. Echoed on every result and folded into recommended_action.
    - `weight` number
    - `sort_order` integer
    - `is_active` boolean

## Other responses

- `400`: Validation error
- `401`: Missing or invalid API key
- `403`: System rule sets are read-only
- `404`: Not found

---

[API](https://skmtc.dev/overwing/apis/overwing-api.md) · [All operations](https://skmtc.dev/overwing/apis/overwing-api/llms.txt) · [OpenAPI document](https://skmtc.dev/overwing/apis/overwing-api/revisions/ff1282d31438?raw)
