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

# Update a blog theme version

> Edits an unpublished theme version in place. Only the files named in `files` are replaced. The published version cannot be edited: create a new version, or edit an older one, and publish that instead. Requires the blog write permission.



## OpenAPI

````yaml /openapi.json post /api/blogThemes.update
openapi: 3.0.3
info:
  title: Notifuse API
  description: API for Notifuse - a transactional email and newsletter management platform
  version: 1.0.0
  contact:
    name: Notifuse Support
    url: https://www.notifuse.com/support
    email: hello@notifuse.com
  license:
    name: BUSL-1.1
    url: https://github.com/Notifuse/notifuse/blob/main/LICENSE
servers:
  - url: https://{notifuseDomain}
    description: Customer-specific Notifuse API server
    variables:
      notifuseDomain:
        description: Your unique Notifuse domain
        default: demo.notifuse.com
security: []
paths:
  /api/blogThemes.update:
    post:
      tags:
        - Blog
      summary: Update a blog theme version
      description: >-
        Edits an unpublished theme version in place. Only the files named in
        `files` are replaced. The published version cannot be edited: create a
        new version, or edit an older one, and publish that instead. Requires
        the blog write permission.
      operationId: updateBlogTheme
      parameters:
        - name: workspace_id
          in: query
          required: true
          schema:
            type: string
          description: The ID of the workspace. Passed in the query string, not the body.
          example: ws_1234567890
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBlogThemeRequest'
      responses:
        '200':
          description: Theme version updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlogThemeResponse'
        '400':
          description: Bad request - version missing, not found or published
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: cannot update published theme
        '401':
          description: Unauthorized - invalid or missing authentication token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - missing the blog write permission
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionErrorResponse'
              example:
                error: 'Insufficient permissions: write access to blog required'
                resource: blog
                permission: write
      security:
        - BearerAuth: []
components:
  schemas:
    UpdateBlogThemeRequest:
      type: object
      required:
        - version
      properties:
        version:
          type: integer
          description: An unpublished theme version.
          example: 4
        files:
          allOf:
            - $ref: '#/components/schemas/BlogThemeFiles'
          description: >-
            Only the files named here are replaced; the others keep their stored
            content. Send a file as `""` to empty it.
        notes:
          type: string
          description: Kept as stored when omitted.
    BlogThemeResponse:
      type: object
      required:
        - theme
      properties:
        theme:
          $ref: '#/components/schemas/BlogTheme'
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
      required:
        - error
    PermissionErrorResponse:
      type: object
      description: >-
        Returned with a 403 when the user or API key lacks the permission the
        endpoint requires.
      properties:
        error:
          type: string
          description: Error message
        resource:
          type: string
          description: The permission resource the endpoint requires.
          example: blog
        permission:
          type: string
          enum:
            - read
            - write
          description: The access level the endpoint requires on that resource.
      required:
        - error
        - resource
        - permission
    BlogThemeFiles:
      type: object
      description: >-
        The theme's source files. Liquid files render the blog's pages; see the
        blog theme guide for the variables each one receives.
      properties:
        home.liquid:
          type: string
          description: The blog home page.
        category.liquid:
          type: string
          description: A category page.
        post.liquid:
          type: string
          description: A post page.
        header.liquid:
          type: string
        footer.liquid:
          type: string
        shared.liquid:
          type: string
          description: Snippets shared by the other templates.
        styles.css:
          type: string
        scripts.js:
          type: string
    BlogTheme:
      type: object
      required:
        - version
        - files
        - created_at
        - updated_at
      properties:
        version:
          type: integer
          description: Assigned on creation, one above the highest existing version.
          example: 4
        published_at:
          type: string
          format: date-time
          description: Present only on the theme currently live on the blog.
        published_by_user_id:
          type: string
          description: >-
            The user or API key that published it. Present only on the live
            theme.
        files:
          $ref: '#/components/schemas/BlogThemeFiles'
        notes:
          type: string
          example: Darker header, larger body text.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API token for authentication

````