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

# Read a saved knowledge document version

> 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. Returns historical metadata and read-only top-level text blocks, up to 20 blocks and 20,000 text characters per page. Each block is capped at 10,000 characters with explicit truncation; specialized blocks may omit non-text/formatting details. offset/nextOffset count blocks. No editable flags or current editing-version token are returned. Unsupported legacy snapshots return 400. The top-level name is the current title; snapshot.name is the historical title. Any document link opens the current document.



## OpenAPI

````yaml /openapi.yaml get /api/knowledge/{id}/history/{versionId}
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/{versionId}:
    get:
      tags:
        - Knowledge
      summary: Read a saved knowledge document version
      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.
        Returns historical metadata and read-only top-level text blocks, up to
        20 blocks and 20,000 text characters per page. Each block is capped at
        10,000 characters with explicit truncation; specialized blocks may omit
        non-text/formatting details. offset/nextOffset count blocks. No editable
        flags or current editing-version token are returned. Unsupported legacy
        snapshots return 400. The top-level name is the current title;
        snapshot.name is the historical title. Any document link opens the
        current document.
      operationId: getKnowledgeDocVersion
      parameters:
        - name: id
          in: path
          required: true
          description: Current knowledge document ID.
          schema:
            type: string
        - name: versionId
          in: path
          required: true
          description: Saved version ID returned by the history list.
          schema:
            type: string
        - name: companyId
          in: query
          description: >-
            Required with a partner token; API key/delegate credentials resolve
            company scope.
          schema:
            type: string
        - name: offset
          in: query
          description: Top-level block 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/KnowledgeHistoryDetail'
        '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:
    KnowledgeHistoryDetail:
      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.
        snapshot:
          $ref: '#/components/schemas/KnowledgeHistoryVersion'
        readOnly:
          type: boolean
          enum:
            - true
        total:
          type: integer
          description: Total top-level blocks in this snapshot.
        blocks:
          type: array
          maxItems: 20
          items:
            type: object
            properties:
              id:
                type: string
              type:
                type: string
              text:
                type: string
                maxLength: 10000
              truncated:
                type: boolean
                description: >-
                  Block text exceeded 10,000 characters; the rest is not
                  returned.
              commented:
                type: boolean
    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.