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

# Update Rule Styles

> Update style names, fill color, and/or text color for a template section rule. Styles are returned automatically with the Get Template endpoint.



## OpenAPI

````yaml /api-reference/openapi-v1.json put /api/v1/templates/{template_id}/rules/{rule_id}/styles
openapi: 3.0.0
info:
  title: Artos API
  description: API for document generation, template management, and document organization
  version: 1.0.0
  contact:
    name: Artos Support
    email: internal@artosai.com
servers:
  - url: https://api.artosai.com
    description: Production server
  - url: http://localhost:8000
    description: Local development server
security:
  - bearerAuth: []
paths:
  /api/v1/templates/{template_id}/rules/{rule_id}/styles:
    put:
      tags:
        - Templates
      summary: Update Rule Styles
      description: >-
        Update style names, fill color, and/or text color for a template section
        rule. Styles are returned automatically with the Get Template endpoint.
      operationId: updateRuleStyles
      parameters:
        - name: template_id
          in: path
          required: true
          description: UUID of template (for authorization)
          schema:
            type: string
        - name: rule_id
          in: path
          required: true
          description: UUID of rule to update
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateRuleStylesRequest'
            example:
              style_names:
                - Heading 2
                - Normal
              fill: '#FFFF00'
              color: null
      responses:
        '200':
          description: Rule styles updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateRuleStylesResponse'
        '400':
          description: Authentication errors
        '403':
          description: Unauthorized access
        '404':
          description: Template or rule not found
        '500':
          description: Database operation failures
components:
  schemas:
    UpdateRuleStylesRequest:
      type: object
      properties:
        style_names:
          type: array
          items:
            type: string
          nullable: true
          description: List of style names to apply (e.g., ['Heading 2', 'Normal'])
        fill:
          type: string
          nullable: true
          description: Background fill color hex (e.g., '#FFFF00') or null to remove
        color:
          type: string
          nullable: true
          description: Text/font color hex (e.g., '#FF0000') or null to remove
    UpdateRuleStylesResponse:
      type: object
      properties:
        rule_id:
          type: string
          description: UUID of the updated rule
        styles:
          type: object
          description: Updated styles object
        updated:
          type: boolean
          default: true
          description: Whether the update was successful
      required:
        - rule_id
        - styles
        - updated
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication. Token provides organization-scoped access.

````