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

# Create a blog category

Creates a category. Posts always belong to one, so a blog needs at least one category before its first post. Requires the blog write permission.

## OpenAPI

````yaml /openapi.json post /api/blogCategories.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/blogCategories.create:
    post:
      summary: Create a blog category
      description: Creates a category. Posts always belong to one, so a blog needs at
        least one category before its first post. Requires the blog write
        permission.
      operationId: createBlogCategory
      tags:
        - Blog
      security:
        - BearerAuth: []
      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/CreateBlogCategoryRequest"
      responses:
        "201":
          description: Category created
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BlogCategoryResponse"
        "400":
          description: Bad request - validation failed or the slug is taken
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              examples:
                slugTaken:
                  value:
                    error: category with slug 'product' already exists
                invalidSlug:
                  value:
                    error: slug must contain only lowercase letters, numbers, and hyphens
                reservedSlug:
                  value:
                    error: slug is reserved by another route
        "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
components:
  schemas:
    BlogCategory:
      type: object
      required:
        - id
        - slug
        - settings
        - created_at
        - updated_at
      properties:
        id:
          type: string
          description: Server-generated UUID.
          example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
        slug:
          type: string
          description: The category's path segment on the blog (`/{category_slug}`).
          example: product
        settings:
          type: object
          required:
            - name
          properties:
            name:
              type: string
              example: Product
            description:
              type: string
              example: Release notes and product announcements.
            seo:
              $ref: "#/components/schemas/SEOSettings"
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    BlogCategoryResponse:
      type: object
      required:
        - category
      properties:
        category:
          $ref: "#/components/schemas/BlogCategory"
    CreateBlogCategoryRequest:
      type: object
      required:
        - name
        - slug
      properties:
        name:
          type: string
          maxLength: 255
          example: Product
        slug:
          type: string
          maxLength: 100
          pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
          description: Lowercase letters, digits and single hyphens. Must be unique among
            the workspace's categories, and may not be a path another route
            answers on the blog's domain (`v`, `t`, `r`, `visit`, `opens`,
            `track`, `preferences`, `subscribe`, `unsubscribe`,
            `unsubscribe-oneclick`, `health`, `healthz`) or start with `api`,
            `console` or `notification-center`. A category keeps such a slug it
            already had.
          example: product
        description:
          type: string
          example: Release notes and product announcements.
        seo:
          $ref: "#/components/schemas/SEOSettings"
    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
    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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API token for authentication
````
