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

# Update a Style Guide

> Updates a Style Guide. When a new file is uploaded, returns 202 with a jobId; poll the **Get update job status** API for the final result. Metadata-only updates return 200 with the updated Style Guide. Set the Content-Type header as multipart/form-data when uploading a file. Omit the Content-Type header for Metadata-only updates.



## OpenAPI

````yaml /openapi/phrase-style-guides.json put /api/v1/styleguides/{id}
openapi: 3.1.0
info:
  version: 1.0.0
  title: Style Guide API
  description: REST API for managing Style Guides on the Phrase Platform
  contact:
    name: Linguistic Assets
    email: engineering@phrase.com
servers:
  - url: https://eu.phrase.com/styleguide
    description: Production
  - url: http://localhost:18062
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Style Guide
    description: Public API for managing Style Guides
paths:
  /api/v1/styleguides/{id}:
    put:
      tags:
        - Style Guide
      summary: Update a Style Guide
      description: >-
        Updates a Style Guide. When a new file is uploaded, returns 202 with a
        jobId; poll the **Get update job status** API for the final result.
        Metadata-only updates return 200 with the updated Style Guide. Set the
        Content-Type header as multipart/form-data when uploading a file. Omit
        the Content-Type header for Metadata-only updates.
      operationId: updateStyleGuide
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: name
          in: query
          description: Updated name
          required: true
          schema:
            type: string
            maxLength: 50
            minLength: 0
        - name: description
          in: query
          description: Updated description
          required: false
          schema:
            type: string
            maxLength: 250
            minLength: 0
        - name: versionChangeReason
          in: query
          description: Optional description of the version change
          required: false
          schema:
            type: string
            maxLength: 250
            minLength: 0
        - name: includeVersions
          in: query
          description: Whether to include versions in the response
          required: false
          schema:
            type: boolean
            default: false
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: >-
                    Optional new file to create a new version. Maximum size: 150
                    KiB.
          '*/*':
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: >-
                    Optional new file to create a new version. Maximum size: 150
                    KiB.
      responses:
        '200':
          description: Metadata-only update completed synchronously
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StyleGuideResponse'
        '202':
          description: Update job accepted
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StyleGuideAsyncAcceptedResponse'
        '400':
          description: >-
            Invalid request data or file. Error codes: VALIDATION_ERROR,
            INVALID_ARGUMENT, UNSUPPORTED_FILE_TYPE, UNSUPPORTED_FILE_EXTENSION.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — invalid or missing authentication token
        '403':
          description: 'Forbidden — MANAGE right required. Error codes: ACCESS_DENIED.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: 'Style Guide not found. Error codes: STYLEGUIDE_NOT_FOUND.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: 'Duplicate Style Guide name. Error codes: DUPLICATE_STYLEGUIDE_NAME.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: 'File too large. Error codes: FILE_SIZE_EXCEEDED.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '415':
          description: 'Unsupported Content-Type. Error codes: UNSUPPORTED_MEDIA_TYPE.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    StyleGuideResponse:
      type: object
      description: Style Guide information
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the Style Guide
          example: 018e1234-5678-7890-abcd-ef1234567890
        name:
          type: string
          description: Name of the Style Guide (latest version)
          example: English Style Guide
          maxLength: 50
        description:
          type: string
          description: Description of the Style Guide (latest version)
          example: Style guide for English content
          maxLength: 250
        language:
          $ref: '#/components/schemas/SupportedLanguageResponse'
          description: Language details
        isDefault:
          type: boolean
          description: Whether this is the default Style Guide
          example: false
        createdBy:
          $ref: '#/components/schemas/UserInfo'
          description: User who created the Style Guide
        lastModifiedBy:
          $ref: '#/components/schemas/UserInfo'
          description: User who last modified the Style Guide
        versions:
          type: array
          description: >-
            List of all versions of this Style Guide. Only present when
            includeVersions=true.
          items:
            $ref: '#/components/schemas/StyleGuideVersionResponse'
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the Style Guide was created
          example: '2024-01-15T10:30:00Z'
        lastModifiedAt:
          type: string
          format: date-time
          description: Timestamp when the Style Guide was last modified
          example: '2024-01-15T10:30:00Z'
    StyleGuideAsyncAcceptedResponse:
      type: object
      properties:
        jobId:
          type: string
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
        message:
          type: string
        detail:
          type: string
    SupportedLanguageResponse:
      type: object
      description: Supported Style Guide language
      properties:
        bcpCode:
          type: string
          description: Language code in BCP-47 format (more specifically RFC 5646 format)
          example: en-GB
        description:
          type: string
          description: Human-readable language name in English
          example: English (United Kingdom)
        region:
          type: string
          description: Region code, or null if not present
          example: gb
        script:
          type: string
          description: Script code when defined, or null
          enum:
            - ARAB
            - ARMN
            - BENG
            - CANS
            - CYRL
            - DEVA
            - GREK
            - GURU
            - HANG
            - HANS
            - HANT
            - HEBR
            - HMNG
            - JPAN
            - KHMR
            - LAOO
            - LATN
            - MONG
            - MTEI
            - MYMR
            - OLCK
            - ORYA
            - PIQD
            - ROHG
            - SIND
            - SYRC
            - TAML
            - TFNG
            - TELU
          example: LATN
        language:
          type: string
          description: ISO 639-1 language code (e.g., 'cs' from 'cs-CZ')
          example: cs
      required:
        - bcpCode
        - description
        - language
    UserInfo:
      type: object
      description: User information
      properties:
        id:
          type: string
          description: User identifier
          example: 0015oCjtouINgRCDIvQtjo
        username:
          type: string
          description: Username
          example: john.doe
        fullName:
          type: string
          description: Full name
          example: John Doe
        email:
          type: string
          description: Email
          example: john.doe@example.com
        avatarUrl:
          type: string
          description: Avatar URL
          example: https://example.com/avatars/john-doe.png
    StyleGuideVersionResponse:
      type: object
      description: Style Guide version information
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the version
          example: 018e1234-5678-7890-abcd-ef1234567890
        versionNumber:
          type: integer
          format: int32
          description: Version number
          example: 1
        name:
          type: string
          description: Name of the version
          example: English Style Guide v1
          maxLength: 50
        description:
          type: string
          description: Description of the version
          example: Initial version of the style guide
          maxLength: 250
        changeNotes:
          type: string
          description: Notes about what changed in this version
          example: Updated grammar rules and added new terminology
        fileName:
          type: string
          description: File name
          example: StyleGuide.md
        fileSizeBytes:
          type: integer
          format: int64
          description: File size in bytes
          example: 1024
        fileType:
          type: string
          description: File MIME type
          example: text/markdown
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the version was created
          example: '2024-01-15T10:30:00Z'
        lastModifiedAt:
          type: string
          format: date-time
          description: Timestamp when the version was last modified
          example: '2024-01-15T10:30:00Z'
        lastModifiedBy:
          $ref: '#/components/schemas/UserInfo'
          description: User who last modified the version
  securitySchemes:
    bearerAuth:
      type: http
      description: 'JWT from IDM (Authorization: Bearer <token>)'
      scheme: bearer
      bearerFormat: JWT

````