> ## 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 a link

Updates link properties. When updating the sort order, provide only the 'sort' field with the new zero-based position - this will reorder the link within its position (HEADER or FOOTER) and adjust neighboring links automatically. When updating other fields, all link properties can be modified individually or together. URLs are automatically prefixed with https\:// if no protocol is provided.


## OpenAPI

````yaml https://api.getfernand.com/openapi.json patch /knowledge/links/{id}
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/links/{id}:
    patch:
      tags:
        - Knowledge Links
      summary: Update a link
      description: >-
        Updates link properties. When updating the sort order, provide only the
        'sort' field with the new zero-based position - this will reorder the
        link within its position (HEADER or FOOTER) and adjust neighboring links
        automatically. When updating other fields, all link properties can be
        modified individually or together. URLs are automatically prefixed with
        https:// if no protocol is provided.
      operationId: updateLink
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: integer
          description: ID of the link to update.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  maxLength: 60
                  description: Display text for the link (optional).
                url:
                  type: string
                  maxLength: 250
                  description: >-
                    Destination URL (optional, automatically prefixed with
                    https:// if missing).
                target:
                  type: string
                  maxLength: 6
                  enum:
                    - _blank
                    - _self
                  description: Link target behavior (optional).
                position:
                  type: string
                  maxLength: 6
                  enum:
                    - HEADER
                    - FOOTER
                  description: Display position (optional, case-insensitive).
                sort:
                  type: integer
                  description: >-
                    New sort position (zero-based, optional). When provided,
                    only updates sort order and returns empty response.
      responses:
        '200':
          description: >-
            Link updated successfully. Returns empty response when only sort was
            updated, otherwise returns the updated link.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/KnowledgeLinkLang'
                  - type: object
                    properties: {}
                    description: Empty response when sort order was updated.
        '400':
          description: Invalid input.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '404':
          description: Link not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
components:
  schemas:
    KnowledgeLinkLang:
      type: object
      description: >-
        Navigation link combined with language-specific content. Inherits all
        properties from KnowledgeLink model and adds language-specific fields.
      allOf:
        - $ref: '#/components/schemas/KnowledgeLink'
        - type: object
          properties:
            title:
              type: string
              maxLength: 250
              description: Display text for the link shown in navigation.
              example: Contact Us
      x-computed-hash: 2b6d21ff36ba971be271b295a5b9e82f064073e6cee1af4f2b803b6ea8fefba5
      x-last-modified: 1769075325
    KnowledgeLink:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: Unique identifier for the link.
        sort:
          type: integer
          description: Sort order within the position (HEADER or FOOTER).
          example: 1
        url:
          type: string
          maxLength: 250
          description: Destination URL for the link.
          example: https://piedpiper.com/contact
        target:
          type: string
          maxLength: 6
          enum:
            - _blank
            - _self
          description: Link target behavior - _blank for new tab, _self for same window.
          example: _blank
        position:
          type: string
          maxLength: 6
          enum:
            - HEADER
            - FOOTER
          description: Where the link is displayed in the knowledge base.
          example: HEADER
      x-computed-hash: e887866a88caa67ffffb49193c7a9ed3c1a580f597ac733824d62223eff3abb9
      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

````