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

# List saved knowledge document versions

> Reads retained saved snapshots of a non-archived knowledge document. Partner tokens require knowledge-docs; API keys or delegate tokens use knowledge read access. Delegate callers must remain active company members and currently be able to view the document; membership, document and team authorization use primary reads. API keys and partner tokens are company-scoped. Archived, deleted, or inaccessible documents return 404. There is no archived override. Snapshots older than the current document creation time are excluded so a reused document ID cannot expose a deleted document history. These are saved versions, not unsaved drafts or a complete edit audit: rapid saves may merge and older history may be pruned (normally 50 versions retained). savedBy records the saver, not necessarily the author of every passage; Hiro before/after snapshots both name the approver. No restore or mutation is performed. Versions sort by savedAt descending, then version ID descending. Date bounds are inclusive instants; date-only values mean midnight UTC without end-of-day expansion. A filtered list may omit a predecessor needed for a comparison: omit the date filter to retrieve earlier versions. Metadata only; use the version detail endpoint for text.



## OpenAPI

````yaml /openapi.yaml get /api/knowledge/{id}/history
openapi: 3.0.3
info:
  title: Aptly API
  version: '1.1'
  description: |
    The Aptly API lets external systems work with boards, contacts, inboxes,
    tasks, files, and other Aptly resources.

    Most endpoints accept an API key in the `x-token` header. Some endpoints
    also accept a delegate token or partner bearer token, as shown in each
    operation's security requirements, and explicitly public endpoints require
    no credential. API keys are scoped to a company and may be restricted to
    specific boards and read, insert, or update permissions; requests outside
    those restrictions receive a 403 `FORBIDDEN` response.
servers:
  - url: https://core-api.getaptly.com
    description: Production
security:
  - ApiKeyHeader: []
paths:
  /api/knowledge/{id}/history:
    get:
      tags:
        - Knowledge
      summary: List saved knowledge document versions
      description: >-
        Reads retained saved snapshots of a non-archived knowledge document.
        Partner tokens require knowledge-docs; API keys or delegate tokens use
        knowledge read access. Delegate callers must remain active company
        members and currently be able to view the document; membership, document
        and team authorization use primary reads. API keys and partner tokens
        are company-scoped. Archived, deleted, or inaccessible documents return
        404. There is no archived override. Snapshots older than the current
        document creation time are excluded so a reused document ID cannot
        expose a deleted document history. These are saved versions, not unsaved
        drafts or a complete edit audit: rapid saves may merge and older history
        may be pruned (normally 50 versions retained). savedBy records the
        saver, not necessarily the author of every passage; Hiro before/after
        snapshots both name the approver. No restore or mutation is performed.
        Versions sort by savedAt descending, then version ID descending. Date
        bounds are inclusive instants; date-only values mean midnight UTC
        without end-of-day expansion. A filtered list may omit a predecessor
        needed for a comparison: omit the date filter to retrieve earlier
        versions. Metadata only; use the version detail endpoint for text.
      operationId: listKnowledgeDocHistory
      parameters:
        - name: id
          in: path
          required: true
          description: Current knowledge document ID.
          schema:
            type: string
        - name: companyId
          in: query
          description: >-
            Required with a partner token; API key/delegate credentials resolve
            company scope.
          schema:
            type: string
        - name: savedFrom
          in: query
          description: Inclusive earliest save time (ISO date or timestamp).
          schema:
            type: string
        - name: savedTo
          in: query
          description: Inclusive latest save time (ISO date or timestamp).
          schema:
            type: string
        - name: savedBy
          in: query
          description: Recorded saver user ID.
          schema:
            type: string
        - name: limit
          in: query
          description: Maximum versions per page.
          schema:
            type: integer
            minimum: 1
            maximum: 50
            default: 20
        - name: offset
          in: query
          description: Pagination offset from nextOffset.
          schema:
            type: integer
            minimum: 0
            maximum: 10000
            default: 0
      responses:
        '200':
          description: 'Saved history. Nullable fields and nextOffset: null are preserved.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeHistoryList'
        '400':
          description: >-
            Invalid filters/pagination, or (detail only) an unsupported
            historical content format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid authentication.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Credential lacks knowledge read access.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            Document inaccessible, archived, or absent; or the requested version
            does not belong to this document and company.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKeyHeader: []
        - DelegateToken: []
        - PartnerBearer: []
components:
  schemas:
    KnowledgeHistoryList:
      type: object
      properties:
        documentId:
          type: string
        name:
          type: string
        note:
          type: string
        nextOffset:
          type: integer
          nullable: true
          description: Pass as offset to continue; null means this result is complete.
        current:
          type: object
          properties:
            updatedAt:
              type: string
              format: date-time
              nullable: true
            updatedBy:
              type: string
              nullable: true
        versions:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeHistoryVersion'
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    KnowledgeHistoryVersion:
      type: object
      properties:
        versionId:
          type: string
        name:
          type: string
          nullable: true
        savedAt:
          type: string
          format: date-time
          nullable: true
        savedBy:
          type: string
          nullable: true
        savedByName:
          type: string
          nullable: true
        conduit:
          type: string
          nullable: true
          description: >-
            hiro identifies a save through Hiro. Saver attribution is not proof
            of passage authorship.
        emoji:
          type: string
          nullable: true
        iconUrl:
          type: string
          nullable: true
        iconFileId:
          type: string
          nullable: true
        coverId:
          type: string
          nullable: true
        coverUrl:
          type: string
          nullable: true
  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>`'

````

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