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

# Create articles in bulk

> This API creates up to 25 articles at once. It is all-or-nothing: if any article fails, none is saved. Articles are saved in order, so a later article's `related_article_ids` can name the slug of an earlier one. For CLI sessions, creating drafts needs the Modify articles permission. Creating an article with `state: published` also needs the Manage articles permission.


> [!NOTE]
>
> Replace `{your-subdomain}` with your workspace's subdomain. \
> Learn how to find your subdomain in [Workspace subdomain](https://apidocs.neetokb.com/api/workspace-subdomain.md).


## OpenAPI

````yaml bundled/articles.yaml POST /articles/bulk
openapi: 3.0.3
info:
  title: NeetoKB Articles API
  version: 1.0.0
servers:
  - description: NeetoKB API
    url: https://{your-subdomain}.neetokb.com/api/external/v2
    variables:
      your-subdomain:
        default: spinkart
        description: >-
          Replace **spinkart** with your [workspace's
          subdomain](/api/workspace-subdomain).
security: []
paths:
  /articles/bulk:
    post:
      summary: Create articles in bulk
      description: >
        This API creates up to 25 articles at once. It is all-or-nothing: if any
        article fails, none is saved. Articles are saved in order, so a later
        article's `related_article_ids` can name the slug of an earlier one. For
        CLI sessions, creating drafts needs the Modify articles permission.
        Creating an article with `state: published` also needs the Manage
        articles permission.
      parameters:
        - $ref: '#/components/parameters/api_key_header'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/batch_create_articles_request'
      responses:
        '201':
          description: Created - Articles created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/batch_create_articles_response'
        '401':
          $ref: '#/components/responses/unauthorized_response'
        '403':
          description: >-
            Forbidden - The CLI session does not have the permission this change
            needs
        '422':
          description: >-
            Unprocessable Entity - `articles` is empty or has more than 25
            entries, or an article is invalid. Nothing is saved, and the message
            names the article, counting from 1.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: >-
                      Article 3 failed, so no article in the batch was saved:
                      Slug has already been taken
components:
  parameters:
    api_key_header:
      in: header
      name: X-Api-Key
      description: >-
        Use the X-Api-Key header to provide your workspace API key. Refer to
        [Authentication](/api/authentication) for more information.
      required: true
      schema:
        type: string
        default: your-api-key
  schemas:
    batch_create_articles_request:
      type: object
      required:
        - articles
      properties:
        articles:
          type: array
          minItems: 1
          maxItems: 25
          items:
            $ref: '#/components/schemas/batch_create_article_item'
          description: >-
            Between 1 and 25 articles. They are saved in order, and the batch is
            all-or-nothing.
    batch_create_articles_response:
      type: object
      properties:
        articles:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              slug:
                type: string
                example: getting-started
              permalink:
                type: string
    batch_create_article_item:
      type: object
      required:
        - title
        - html_content
        - category
      properties:
        title:
          type: string
          maxLength: 160
          description: Title of the article.
          example: Getting Started
        html_content:
          type: string
          description: Content of the article in HTML format.
          example: <h1>Welcome</h1><p>Example content</p>
        category:
          type: array
          items:
            type: string
          description: >-
            Category path as an array of category names, most specific first.
            Categories that do not exist are created.
          example:
            - Installation
            - Getting Started
        state:
          type: string
          enum:
            - draft
            - published
          default: draft
          description: Status of the article.
        slug:
          type: string
          description: URL-friendly version of the article's title.
          example: getting-started
        tags:
          type: array
          items:
            type: string
          description: >-
            Tag names to attach to the article. Tags that do not exist are
            created.
          example:
            - billing
            - faq
        related_article_ids:
          type: array
          items:
            type: string
          description: >-
            Related articles, each given by slug, permalink identifier or UUID.
            An item can name the slug of an article earlier in the same batch.
          example:
            - refund-policy
            - a-84af178b
        note:
          type: string
          description: Internal note on the article.
          example: Review again after the pricing change.
  responses:
    unauthorized_response:
      description: Unauthorized - API key is missing or invalid

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.