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

# Reorder category articles

> This API sets the order of articles in a category. Listed articles get positions 1 to n. Articles of the category that you leave out follow in their current order. The `put` method works too. For CLI sessions, this needs the Manage categories 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/categories.yaml PATCH /categories/{category_id}/article_order
openapi: 3.0.3
info:
  title: NeetoKB Categories API
  description: APIs to list, create, update, delete and reorder categories in a workspace.
  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:
  /categories/{category_id}/article_order:
    patch:
      tags:
        - Categories
      summary: Reorder category articles
      description: >
        This API sets the order of articles in a category. Listed articles get
        positions 1 to n. Articles of the category that you leave out follow in
        their current order. The `put` method works too. For CLI sessions, this
        needs the Manage categories permission.
      parameters:
        - $ref: '#/components/parameters/api_key_header'
        - in: path
          name: category_id
          description: Category ID or slug.
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - article_ids
              properties:
                article_ids:
                  type: array
                  items:
                    type: string
                  description: >-
                    Articles in the order you want, each given by slug,
                    permalink identifier or UUID. Each must be in this category.
                    No repeats.
                  example:
                    - getting-started
                    - a-84af178b
      responses:
        '200':
          description: OK - Request succeeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  articles:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        slug:
                          type: string
                        title:
                          type: string
                        sequence:
                          type: integer
        '401':
          $ref: '#/components/responses/unauthorized_response'
        '403':
          $ref: '#/components/responses/forbidden_response'
        '404':
          description: Not Found - The category does not exist, or an article is not in it
        '422':
          description: >-
            Unprocessable Entity - `article_ids` is empty or has repeated
            entries
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_body'
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
  responses:
    unauthorized_response:
      description: Unauthorized - API key is missing or invalid
    forbidden_response:
      description: >-
        Forbidden - The CLI session does not have the permission this change
        needs
  schemas:
    error_body:
      type: object
      properties:
        error:
          type: string

````

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