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

# Get a knowledge document

> Returns a knowledge document's full detail — folder path, shares, direct children,
links to any board/card/conversation, view counts, and content rendered as HTML.

`currentUser` is populated only when authenticated with a delegate token (its
`userId` is known); it is `null` for API keys and partner tokens, which are
company-wide credentials with no per-user permission check. A private document you
cannot view returns 404, the same as one that doesn't exist. Unlike `list`/`tree`/
`children`, this is a direct by-id fetch, so an archived document is still
returned (with `archived: true`) rather than 404ing.




## OpenAPI

````yaml /openapi.yaml get /api/knowledge/{id}
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}:
    get:
      tags:
        - Knowledge
      summary: Get a knowledge document
      description: >
        Returns a knowledge document's full detail — folder path, shares, direct
        children,

        links to any board/card/conversation, view counts, and content rendered
        as HTML.


        `currentUser` is populated only when authenticated with a delegate token
        (its

        `userId` is known); it is `null` for API keys and partner tokens, which
        are

        company-wide credentials with no per-user permission check. A private
        document you

        cannot view returns 404, the same as one that doesn't exist. Unlike
        `list`/`tree`/

        `children`, this is a direct by-id fetch, so an archived document is
        still

        returned (with `archived: true`) rather than 404ing.
      operationId: getKnowledgeDoc
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: The knowledge document ID.
      responses:
        '200':
          description: Knowledge document detail.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeDoc'
              example:
                _id: kdoc_abc123
                name: Lease Addendum Policy
                emoji: null
                iconUrl: null
                coverUrl: null
                accessType: public
                isPrivate: false
                shares: []
                parentId: null
                path: []
                children: []
                childCount: 0
                links:
                  aptletUuid: null
                  aptletInstanceId: null
                  streamId: null
                published: false
                publishedAt: null
                views:
                  internal: 0
                  public: 0
                archived: false
                archivedAt: null
                createdAt: '2026-01-05T12:00:00.000Z'
                createdBy: user_123
                updatedAt: '2026-01-05T12:00:00.000Z'
                updatedBy: user_123
                currentUser: null
                html: <p>This policy applies to all lease agreements...</p>
        '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:
    KnowledgeDoc:
      type: object
      description: Full document detail returned by GET /api/knowledge/{id}.
      properties:
        _id:
          type: string
          description: Document ID.
        name:
          type: string
          description: Document title.
        emoji:
          type: string
          nullable: true
        iconUrl:
          type: string
          nullable: true
        coverUrl:
          type: string
          nullable: true
        accessType:
          type: string
          enum:
            - public
            - publicReadonly
            - private
        isPrivate:
          type: boolean
        shares:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              type:
                type: string
                enum:
                  - user
                  - team
              permission:
                type: string
                enum:
                  - edit
                  - comment
                  - view
              owner:
                type: boolean
              createdAt:
                type: string
                format: date-time
                nullable: true
              updatedAt:
                type: string
                format: date-time
                nullable: true
        parentId:
          type: string
          nullable: true
        path:
          type: array
          description: >-
            Root-first ancestor chain (folders above this document). Excludes
            this document.
          items:
            type: object
            properties:
              _id:
                type: string
              name:
                type: string
              emoji:
                type: string
                nullable: true
        children:
          type: array
          items:
            type: object
            properties:
              _id:
                type: string
              name:
                type: string
              emoji:
                type: string
                nullable: true
              rank:
                type: integer
                nullable: true
        childCount:
          type: integer
        links:
          type: object
          properties:
            aptletUuid:
              type: string
              nullable: true
            aptletInstanceId:
              type: string
              nullable: true
            streamId:
              type: string
              nullable: true
        published:
          type: boolean
        publishedAt:
          type: string
          format: date-time
          nullable: true
        views:
          type: object
          properties:
            internal:
              type: integer
            public:
              type: integer
        archived:
          type: boolean
        archivedAt:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
          nullable: true
        createdBy:
          type: string
          nullable: true
        updatedAt:
          type: string
          format: date-time
          nullable: true
        updatedBy:
          type: string
          nullable: true
        currentUser:
          type: object
          nullable: true
          description: >
            Null for API key / partner token callers — those credentials are
            company-wide, so no per-user permission check is applied. Populated
            only for a delegate token, where the caller's own user identity is
            known.
          properties:
            userId:
              type: string
            isOwner:
              type: boolean
            permission:
              type: string
              nullable: true
              enum:
                - edit
                - comment
                - view
                - null
            canView:
              type: boolean
            canEdit:
              type: boolean
            canComment:
              type: boolean
        html:
          type: string
          description: Document body rendered as HTML.
    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>`'

````

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