> ## 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.

# Create a blog theme version

> Saves a new, unpublished theme version, numbered one above the highest existing version. Files left out are stored empty. Nothing changes on the blog until the version is published. Requires the blog write permission.



## OpenAPI

````yaml /openapi.json post /api/blogThemes.create
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.create:
    post:
      tags:
        - Blog
      summary: Create a blog theme version
      description: >-
        Saves a new, unpublished theme version, numbered one above the highest
        existing version. Files left out are stored empty. Nothing changes on
        the blog until the version is published. Requires the blog write
        permission.
      operationId: createBlogTheme
      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/CreateBlogThemeRequest'
      responses:
        '201':
          description: Theme version created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlogThemeResponse'
        '400':
          description: Bad request - malformed body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Invalid request body
        '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
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    CreateBlogThemeRequest:
      type: object
      properties:
        files:
          $ref: '#/components/schemas/BlogThemeFiles'
        notes:
          type: string
          example: Darker header, larger body text.
    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

````