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

# Update the position of an article

Changes the display order of an article within a specific collection. The article maintains its position in other collections it belongs to. Provide the zero-based sort position and the collection\_id (or null for root). The endpoint automatically adjusts the sort order of surrounding articles to maintain sequence integrity. This is collection-scoped - it reorders the article within one collection, not across all collections the article belongs to.


## OpenAPI

````yaml https://api.getfernand.com/openapi.json patch /knowledge/articles/{id}/collections
openapi: 3.0.3
info:
  title: Fernand API Documentation
  version: '3.0'
  description: This is the documentation for the [Fernand](https://getfernand.com) API.
  termsOfService: https://getfernand.com/terms
  contact:
    name: Fernand Support
    url: https://getfernand.com
    email: support@getfernand.com
  x-logo:
    url: https://app.getfernand.com/images/favicon/icon_128.png
servers:
  - url: https://api.getfernand.com
    description: ''
    x-last-modified: 1764750693905
security:
  - apiKeyHeader: []
externalDocs:
  description: You can access our documentation online by visiting https://api.fernand.help
  url: https://api.fernand.help
paths:
  /knowledge/articles/{id}/collections:
    patch:
      tags:
        - Knowledge Articles
      summary: Update the position of an article
      description: >-
        Changes the display order of an article within a specific collection.
        The article maintains its position in other collections it belongs to.
        Provide the zero-based sort position and the collection_id (or null for
        root). The endpoint automatically adjusts the sort order of surrounding
        articles to maintain sequence integrity. This is collection-scoped - it
        reorders the article within one collection, not across all collections
        the article belongs to.
      operationId: updateArticleSort
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
          description: ID of the article to reorder.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sort:
                  type: integer
                  description: >-
                    New zero-based sort position within the collection
                    (required).
                  example: 2
                collection_id:
                  type: integer
                  nullable: true
                  description: >-
                    ID of the collection to reorder within (required, null for
                    root level).
              required:
                - sort
                - collection_id
      responses:
        '200':
          description: Article sort order updated successfully.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ArticleInCollection'
                description: >-
                  Updated list of all collection assignments for this article
                  with their sort positions.
        '400':
          description: Invalid sort position or collection_id.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '404':
          description: Article or collection assignment not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
components:
  schemas:
    ArticleInCollection:
      type: object
      description: >-
        Junction table representing the relationship between articles and
        collections with sort ordering.
      properties:
        article_id:
          type: integer
          format: int64
          description: ID of the article in this relationship.
        collection_id:
          type: integer
          nullable: true
          description: >-
            ID of the collection containing the article (null for root-level
            placement).
        sort:
          type: integer
          description: Zero-based sort position of the article within the collection.
          example: 2
      x-computed-hash: bad32f8f85976911c32c6fdcb5189b1c8cbb1affc89245f0bab5303a3f660bcf
      x-last-modified: 1769075325
  securitySchemes:
    apiKeyHeader:
      type: apiKey
      description: >-
        Authenticate your account by including your secret key in API requests.

        You can manage your API keys in the
        [Dashboard](https://app.getfernand.com/).


        Authentication to the API is performed by using the HTTP Header
        X-API-Key.
      name: X-API-Key
      in: header
      x-last-modified: 1764750344730

````