> ## 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 a style guide

> Updates a style guide's name, description, enabled-by-default setting, or sections. The style guide is identified by its developer ID — use 'default' to update the built-in Ditto Style Guide's enabled-by-default setting. Only provided fields are modified. Updating sections replaces the full list — each sectionId must be unique within the style guide, and the list must include at least one 'rules' section and one 'wordlist' section; rules belonging to a removed section are automatically moved to the first remaining rules section.



## OpenAPI

````yaml openapi.json patch /styleguides
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:
    patch:
      tags:
        - Style guides
      summary: Update a style guide
      description: >-
        Updates a style guide's name, description, enabled-by-default setting,
        or sections. The style guide is identified by its developer ID — use
        'default' to update the built-in Ditto Style Guide's enabled-by-default
        setting. Only provided fields are modified. Updating sections replaces
        the full list — each sectionId must be unique within the style guide,
        and the list must include at least one 'rules' section and one
        'wordlist' section; rules belonging to a removed section are
        automatically moved to the first remaining rules section.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                developerId:
                  type: string
                  minLength: 1
                  description: >-
                    Developer ID of the style guide to update. Use 'default' to
                    update the built-in Ditto Style Guide's enabled-by-default
                    setting.
                name:
                  type: string
                  minLength: 1
                  description: >-
                    New name for the style guide. If not provided, name remains
                    unchanged.
                description:
                  type: string
                  minLength: 1
                  description: >-
                    New description for the style guide. If not provided,
                    description remains unchanged.
                enabledByDefault:
                  type: boolean
                  description: >-
                    Whether this style guide is enabled by default for all
                    projects.
                sections:
                  type: array
                  items:
                    type: object
                    properties:
                      sectionId:
                        type: string
                      name:
                        type: string
                      kind:
                        type: string
                        enum:
                          - rules
                          - wordlist
                    required:
                      - sectionId
                      - name
                      - kind
                  description: >-
                    Full replacement list of sections. Each section's sectionId
                    must be unique within the style guide. Must include at least
                    one 'rules' section and one 'wordlist' section. Rules
                    belonging to a removed section are automatically moved to
                    the first remaining rules section.
              required:
                - developerId
              example:
                developerId: acme-inc
                name: Acme Inc. Style Guide
            examples:
              rename:
                summary: Rename a style guide
                value:
                  developerId: acme-inc
                  name: Acme Inc. Style Guide
              toggle_enabled:
                summary: Toggle whether it's enabled by default
                value:
                  developerId: acme-inc
                  enabledByDefault: false
              toggle_default_guide:
                summary: Toggle the built-in Ditto Style Guide
                value:
                  developerId: default
                  enabledByDefault: false
              update_sections:
                summary: Replace the sections list
                value:
                  developerId: acme-inc
                  sections:
                    - sectionId: foundations
                      name: Foundations
                      kind: rules
                    - sectionId: word-list
                      name: Word List
                      kind: wordlist
      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: no fields provided to update, a sections update missing a
            'rules' or 'wordlist' section, or duplicate sectionIds within the
            sections list.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing the validation failure
                required:
                  - message
              example:
                message: At least one wordlist section is required
        '404':
          description: >-
            Returned when the developer ID does not match any style guide in the
            workspace
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing the validation failure
                required:
                  - message
              example:
                message: Style guide with developer ID 'acme-inc' not found
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````