> ## 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 (v2)

> Updates a Style Guide with a Content Group. 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. Content-Type can be omitted for metadata-only updates; use multipart/form-data when uploading a file. 



## OpenAPI

````yaml /openapi/phrase-style-guides.json put /api/v2/styleguides/{id}
openapi: 3.1.0
info:
  version: 1.1.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 EU
  - url: https://us.phrase.com/styleguide
    description: Production US
security:
  - bearerAuth: []
tags:
  - name: Style Guide
    description: Public API for managing Style Guides
  - name: Rule
    description: Public API for managing Rules
paths:
  /api/v2/styleguides/{id}:
    put:
      tags:
        - Style Guide
      summary: Update a Style Guide (v2)
      description: >-
        Updates a Style Guide with a Content Group. 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. Content-Type can be omitted for metadata-only updates; use
        multipart/form-data when uploading a file. 
      operationId: updateStyleGuideV2
      parameters:
        - name: id
          in: path
          description: Style Guide ID
          required: true
          schema:
            type: string
            format: uuid
          example: 01900000-0000-7000-8000-000000000001
        - 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
        - name: contentGroupId
          in: query
          description: Content Group identifier from the Content Group Service.
          required: true
          schema:
            type: string
            minLength: 1
      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, MISSING_REQUEST_PARAMETER, 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: >-
            Resource not found. Error codes: STYLEGUIDE_NOT_FOUND,
            CONTENT_GROUP_NOT_FOUND.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: >-
            Conflict. Error codes: DUPLICATE_STYLEGUIDE_NAME,
            DUPLICATE_CONTENT_GROUP_LANGUAGE, API_VERSION_NOT_AVAILABLE.
          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'
        '503':
          description: >-
            Upstream service temporarily unavailable. Error codes:
            SERVICE_UNAVAILABLE.
          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
        contentGroup:
          $ref: '#/components/schemas/ContentGroupResponse'
          description: Content group associated with this 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'
        extractedRulesCount:
          type: integer
          format: int32
          description: >-
            Number of rules extracted and linked to the content group during
            this create/update operation. Only present for create/update
            responses when a content group is set; absent otherwise.
          example: 25
    StyleGuideAsyncAcceptedResponse:
      type: object
      description: Accepted response for an async Style Guide operation
      properties:
        jobId:
          type: string
          description: Job identifier; use this to poll the job-status endpoint
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
      required:
        - jobId
    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
    ContentGroupResponse:
      type: object
      description: Content group reference
      properties:
        id:
          type: string
          description: Content group identifier
          example: my-content-group
    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
        contentGroup:
          $ref: '#/components/schemas/ContentGroupResponse'
          description: Content group associated with this version
  securitySchemes:
    bearerAuth:
      type: http
      description: 'JWT from IDM (Authorization: Bearer <token>)'
      scheme: bearer
      bearerFormat: JWT

````