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

> Creates a post as a draft. The post holds the metadata; its body lives in a web template, so publishing a post over the API takes three calls:

1. `templates.create` with `channel: "web"`, `category: "blog"` and a `web` object. `web.html` is the body readers see, rendered as-is. `web.content` is required and is the Tiptap document the console editor opens; if you only have HTML, send `{"type": "doc", "content": []}`, and do not edit that post in the console afterwards, because saving there regenerates `web.html` from `web.content`.
2. `blogPosts.create` with that template's `id` as `template_id`.
3. `blogPosts.publish`.

Requires the blog write permission, plus the templates write permission for step 1.




## OpenAPI

````yaml /openapi.json post /api/blogPosts.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/blogPosts.create:
    post:
      tags:
        - Blog
      summary: Create a blog post
      description: >
        Creates a post as a draft. The post holds the metadata; its body lives
        in a web template, so publishing a post over the API takes three calls:


        1. `templates.create` with `channel: "web"`, `category: "blog"` and a
        `web` object. `web.html` is the body readers see, rendered as-is.
        `web.content` is required and is the Tiptap document the console editor
        opens; if you only have HTML, send `{"type": "doc", "content": []}`, and
        do not edit that post in the console afterwards, because saving there
        regenerates `web.html` from `web.content`.

        2. `blogPosts.create` with that template's `id` as `template_id`.

        3. `blogPosts.publish`.


        Requires the blog write permission, plus the templates write permission
        for step 1.
      operationId: createBlogPost
      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/CreateBlogPostRequest'
      responses:
        '201':
          description: Post created as a draft
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BlogPostResponse'
        '400':
          description: Bad request - validation failed, slug taken or category not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                slugTaken:
                  value:
                    error: post with slug 'october-release' already exists
                unknownCategory:
                  value:
                    error: 'category not found: blog category not found'
        '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:
    CreateBlogPostRequest:
      type: object
      required:
        - category_id
        - slug
        - title
        - template_id
      properties:
        category_id:
          type: string
          description: An existing category.
          example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
        slug:
          type: string
          maxLength: 100
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
          description: >-
            Lowercase letters, digits and single hyphens. Must be unique across
            the whole workspace, not just within the category.
          example: october-release
        title:
          type: string
          maxLength: 500
          example: What shipped in October
        template_id:
          type: string
          description: >-
            A web template (`channel: web`) holding the post body — create it
            first with `templates.create`. Its existence is not checked here: a
            post pointing at a missing template is saved and renders with an
            empty body.
          example: blog_october_release
        template_version:
          type: integer
          default: 0
          description: >-
            The template version to render. Omit it (or send `0`) to always
            render the template's latest version; pin a version to control
            exactly when a template edit reaches readers.
          example: 1
        excerpt:
          type: string
          example: A faster editor, scheduled broadcasts and a new API.
        featured_image_url:
          type: string
          example: https://cdn.example.com/blog/october.png
        authors:
          type: array
          items:
            $ref: '#/components/schemas/BlogAuthor'
        reading_time_minutes:
          type: integer
          example: 4
        seo:
          $ref: '#/components/schemas/SEOSettings'
    BlogPostResponse:
      type: object
      required:
        - post
      properties:
        post:
          $ref: '#/components/schemas/BlogPost'
    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
    BlogAuthor:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          example: Jane Doe
        avatar_url:
          type: string
          example: https://cdn.example.com/avatars/jane.png
    SEOSettings:
      type: object
      description: Search and social metadata for the page, exposed to the blog theme.
      properties:
        meta_title:
          type: string
          example: Release notes for October
        meta_description:
          type: string
          example: Everything that shipped this month.
        og_title:
          type: string
          description: Open Graph title
        og_description:
          type: string
          description: Open Graph description
        og_image:
          type: string
          description: Open Graph image URL
          example: https://cdn.example.com/og/october.png
        canonical_url:
          type: string
          example: https://blog.example.com/product/october-release
        keywords:
          type: array
          items:
            type: string
          example:
            - release
            - changelog
        meta_robots:
          type: string
          description: Content of the robots meta tag.
          example: index,follow
    BlogPost:
      type: object
      required:
        - id
        - category_id
        - slug
        - settings
        - created_at
        - updated_at
      properties:
        id:
          type: string
          description: Server-generated UUID.
          example: 1b4e28ba-2fa1-11d2-883f-0016d3cca427
        category_id:
          type: string
          example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
        slug:
          type: string
          description: >-
            The post's path segment on the blog
            (`/{category_slug}/{post_slug}`).
          example: october-release
        settings:
          type: object
          required:
            - title
            - template
            - reading_time_minutes
          properties:
            title:
              type: string
              description: The post's H1.
              example: What shipped in October
            template:
              type: object
              required:
                - template_id
                - template_version
              description: The web template holding the post body.
              properties:
                template_id:
                  type: string
                  example: blog_october_release
                template_version:
                  type: integer
                  description: >-
                    The template version the post renders. `0` means the latest
                    version, whatever it is at render time.
                  example: 3
            excerpt:
              type: string
              example: A faster editor, scheduled broadcasts and a new API.
            featured_image_url:
              type: string
              example: https://cdn.example.com/blog/october.png
            authors:
              type: array
              nullable: true
              items:
                $ref: '#/components/schemas/BlogAuthor'
            reading_time_minutes:
              type: integer
              description: Displayed as given; not computed from the body.
              example: 4
            seo:
              $ref: '#/components/schemas/SEOSettings'
        published_at:
          type: string
          format: date-time
          description: Absent while the post is a draft.
          example: '2026-10-01T09:00:00Z'
        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

````