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

# Update style guide rules

> Updates a set of style guide rules, each identified by its Developer ID (from POST /styleguides/rules or GET /styleguides). Only provided fields are modified. Use 'name'/'examples' for a rule in a 'rules' section, or 'term'/'disallowed' for a rule in a 'wordlist' section — the shape must match that rule's own section, not the request as a whole, since a single call may update rules across different sections. The operation is all-or-nothing: if any update is invalid, none are applied.



## OpenAPI

````yaml openapi.json patch /styleguides/rules
openapi: 3.0.0
info:
  version: 1.0.0
  title: Ditto API
  description: Programmatically read and write data in your Ditto workspace.
servers:
  - url: https://api.dittowords.com/v2
security: []
paths:
  /styleguides/rules:
    patch:
      tags:
        - Style guides
      summary: Update style guide rules
      description: >-
        Updates a set of style guide rules, each identified by its Developer ID
        (from POST /styleguides/rules or GET /styleguides). Only provided fields
        are modified. Use 'name'/'examples' for a rule in a 'rules' section, or
        'term'/'disallowed' for a rule in a 'wordlist' section — the shape must
        match that rule's own section, not the request as a whole, since a
        single call may update rules across different sections. The operation is
        all-or-nothing: if any update is invalid, none are applied.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                updates:
                  type: array
                  items:
                    anyOf:
                      - type: object
                        properties:
                          ruleId:
                            type: string
                            minLength: 1
                            description: >-
                              Developer ID of the rule to update (from POST
                              /styleguides/rules or GET /styleguides).
                          description:
                            type: string
                            description: >-
                              Updated description. If not provided, description
                              remains unchanged.
                          tags:
                            type: array
                            items:
                              type: string
                            description: Replaces all existing tags.
                          enabled:
                            type: boolean
                            description: Whether the rule is enabled.
                          name:
                            type: string
                            minLength: 1
                            description: >-
                              Updated name. Only valid for rules in a 'rules'
                              section.
                          examples:
                            type: array
                            items:
                              type: object
                              properties:
                                from:
                                  type: string
                                  description: Text that violates the rule.
                                to:
                                  type: string
                                  description: Corrected version of the text.
                              required:
                                - from
                                - to
                            description: >-
                              Replaces all existing examples. Only valid for
                              rules in a 'rules' section.
                        required:
                          - ruleId
                        additionalProperties: false
                      - type: object
                        properties:
                          ruleId:
                            type: string
                            minLength: 1
                            description: >-
                              Developer ID of the rule to update (from POST
                              /styleguides/rules or GET /styleguides).
                          description:
                            type: string
                            description: >-
                              Updated description. If not provided, description
                              remains unchanged.
                          tags:
                            type: array
                            items:
                              type: string
                            description: Replaces all existing tags.
                          enabled:
                            type: boolean
                            description: Whether the rule is enabled.
                          term:
                            type: string
                            minLength: 1
                            description: >-
                              Updated preferred term. Only valid for rules in a
                              'wordlist' section.
                          disallowed:
                            type: array
                            items:
                              type: string
                            description: >-
                              Replaces all existing disallowed words/phrases.
                              Only valid for rules in a 'wordlist' section.
                        required:
                          - ruleId
                        additionalProperties: false
                  minItems: 1
                  description: >-
                    Rules to update, identified by ruleId. Only provided fields
                    are changed. Use 'name'/'examples' for a rule in a 'rules'
                    section, or 'term'/'disallowed' for a rule in a 'wordlist'
                    section — the shape must match that rule's own section.
              required:
                - updates
              example:
                updates:
                  - ruleId: be-concise
                    description: Updated description
            examples:
              update_style_rule:
                summary: Update a rule in a 'rules' section
                value:
                  updates:
                    - ruleId: be-concise
                      name: Be extremely concise
                      examples:
                        - from: Please click the button below
                          to: Click below
              update_wordlist_entry:
                summary: Update an entry in a 'wordlist' section
                value:
                  updates:
                    - ruleId: ai-agent
                      term: AI agent
                      disallowed:
                        - bot
                        - chatbot
                        - virtual assistant
              disable_rule:
                summary: Disable a rule without deleting it
                value:
                  updates:
                    - ruleId: be-concise
                      enabled: false
      responses:
        '200':
          description: Returns success status of the update operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Indicates whether the update was successful
                required:
                  - success
                example:
                  success: true
        '400':
          description: >-
            Returned when the request body fails validation. Common causes
            include: providing both 'name' and 'term' (or both 'examples' and
            'disallowed') for the same update, or a field that doesn't match the
            rule's own section kind (e.g. 'term' for a rule in a 'rules'
            section).
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing the validation failure
                required:
                  - message
              example:
                message: >-
                  Rule 'be-concise' is in a rules section; use 'name'/'examples'
                  instead of 'term'/'disallowed'.
        '404':
          description: Returned when a ruleId does not match any rule in the workspace
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing the validation failure
                required:
                  - message
              example:
                message: 'Rule id not found: missing-rule'
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````