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

# Update a knowledge document

> Updates a knowledge document's content and/or metadata. Only fields provided in the
request body are updated — omitted fields are left unchanged. Provide either `html`
or `markdown`, not both.




## OpenAPI

````yaml /openapi.yaml put /api/knowledge/{id}
openapi: 3.0.3
info:
  title: Aptly API
  version: '1.0'
  description: >
    The Aptly API lets you read and write cards on any Aptly board from external
    systems.


    All requests require an API key passed as the `x-token` header.

    API keys are scoped to your company and work across all boards.
servers:
  - url: https://core-api.getaptly.com
    description: Production
security:
  - ApiKeyHeader: []
paths:
  /api/knowledge/{id}:
    put:
      tags:
        - Knowledge
      summary: Update a knowledge document
      description: >
        Updates a knowledge document's content and/or metadata. Only fields
        provided in the

        request body are updated — omitted fields are left unchanged. Provide
        either `html`

        or `markdown`, not both.
      operationId: updateKnowledgeDoc
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The knowledge document ID.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              not:
                required:
                  - html
                  - markdown
              properties:
                name:
                  type: string
                  description: New document title.
                html:
                  type: string
                  description: >-
                    Replacement HTML content for the document body. Mutually
                    exclusive with `markdown`.
                markdown:
                  type: string
                  description: >-
                    Replacement Markdown content for the document body. Mutually
                    exclusive with `html`.
                accessType:
                  type: string
                  enum:
                    - public
                    - private
                  description: New access level.
            example:
              name: Updated Lease Addendum Policy
              html: <p>Revised policy effective March 2026...</p>
      responses:
        '200':
          description: Document updated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  _id:
                    type: string
        '400':
          description: Both `html` and `markdown` were provided (only one is allowed).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Invalid or missing API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Document not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyHeader: []
        - DelegateToken: []
        - PartnerBearer: []
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-token
    DelegateToken:
      type: apiKey
      in: header
      name: Authorization
      description: 'Delegate token issued by the platform. Format: `DelegateToken <token>`'
    PartnerBearer:
      type: http
      scheme: bearer
      description: 'Partner token. Format: `Authorization: Bearer <token>`'

````