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

# Get All Knowledge Base Items

> Returns every entry in the AI knowledge base — FAQs, document chunks and self-learned entries — newest first.



## OpenAPI

````yaml api-reference/openapi-generated.json GET /v1/knowledge-base
openapi: 3.0.3
info:
  title: Periskope API
  version: 1.0.0
  description: >-
    Periskope external API.


    Responses use a flat, unwrapped shape: most endpoints return the resource at
    the top level, and list endpoints return a wrapper object with pagination
    inline (e.g. `{ from, to, count, chats: [...] }`). The documented response
    schemas describe these shapes directly.
servers:
  - url: https://api.periskope.app
security:
  - bearerAuth: []
paths:
  /v1/knowledge-base:
    get:
      tags:
        - Knowledge Base
      summary: List knowledge base entries
      description: >-
        Returns every entry in the AI knowledge base — FAQs, document chunks and
        self-learned entries — newest first.
      operationId: listKnowledgeBase
      parameters:
        - schema:
            type: integer
            nullable: true
            minimum: 0
            description: >-
              Number of records to skip before the first returned record. Use
              together with limit to paginate: page N is offset = N * limit.
              Defaults to 0.
            example: 0
          required: false
          description: >-
            Number of records to skip before the first returned record. Use
            together with limit to paginate: page N is offset = N * limit.
            Defaults to 0.
          name: offset
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 2000
            description: >-
              Maximum number of entries to return in one page. Defaults to 1000;
              cannot exceed 2000.
            example: 1000
          required: false
          description: >-
            Maximum number of entries to return in one page. Defaults to 1000;
            cannot exceed 2000.
          name: limit
          in: query
        - schema:
            type: string
            enum:
              - faq
              - document
              - self-learned
            description: >-
              Return only entries of one kind: 'faq', 'document' (chunks of
              uploaded PDFs) or 'self-learned'. Omit to return every entry.
            example: faq
          required: false
          description: >-
            Return only entries of one kind: 'faq', 'document' (chunks of
            uploaded PDFs) or 'self-learned'. Omit to return every entry.
          name: type
          in: query
      responses:
        '200':
          description: Paginated list of knowledge-base entries
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/KnowledgeBaseContext'
                    description: >-
                      The knowledge-base entries in this page, newest first.
                      Null when no entries are returned.
                  count:
                    type: integer
                    description: >-
                      Exact total number of entries across all pages (not this
                      page size). Null when unavailable.
                    example: 135
              examples:
                default:
                  summary: Response body
                  value:
                    data:
                      - context_id: 00000000-0000-0000-0000-000000000000
                        org_id: 00000000-0000-0000-0000-000000000000
                        question: What is Periskope?
                        answer: Periskope is a platform to manage WhatsApp at scale.
                        type: faq
                        embedding: '[-0.0123,0.0456,0.0789,...]'
                        attachments:
                          - link:
                              url: >-
                                org-assets/00000000-0000-0000-0000-000000000000/ai_assets/00000000-0000-0000-0000-000000000000/pricing.pdf
                              type: application/pdf
                              name: pricing.pdf
                        avg_rating: null
                        document_id: 00000000-0000-0000-0000-000000000000
                        is_active: true
                        metadata:
                          fileName: product-faq.pdf
                          chunkIndex: 1
                          tokenCount: 180
                          source: qa
                        tags: null
                        created_at: '2026-01-15T09:30:00.000Z'
                        updated_at: '2026-01-15T09:30:00.000Z'
                    count: 135
        '401':
          description: Invalid, expired or missing API token
          content:
            application/json:
              examples:
                error:
                  summary: Invalid, expired or missing API token
                  value:
                    code: UNAUTHORIZED_ERROR
                    message: Invalid bearer auth token
                    status: 401
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: UNAUTHORIZED_ERROR
                  message:
                    type: string
                    example: Invalid bearer auth token
                  status:
                    type: integer
                    example: 401
                example:
                  code: UNAUTHORIZED_ERROR
                  message: Invalid bearer auth token
                  status: 401
        '422':
          description: Request validation failed
          content:
            application/json:
              examples:
                error:
                  summary: Request validation failed
                  value:
                    code: VALIDATION_ERROR
                    message: Request validation failed
                    status: 422
                    fields:
                      body.chat_id:
                        message: chat_id is required
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: VALIDATION_ERROR
                  message:
                    type: string
                    example: Request validation failed
                  status:
                    type: integer
                    example: 422
                  fields:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        message:
                          type: string
                        value: {}
                    example:
                      body.chat_id:
                        message: chat_id is required
                example:
                  code: VALIDATION_ERROR
                  message: Request validation failed
                  status: 422
                  fields:
                    body.chat_id:
                      message: chat_id is required
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              examples:
                error:
                  summary: Rate limit exceeded
                  value:
                    code: RATE_LIMIT_ERROR
                    message: You can only make 100 requests per second
                    status: 429
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: RATE_LIMIT_ERROR
                  message:
                    type: string
                    example: You can only make 100 requests per second
                  status:
                    type: integer
                    example: 429
                example:
                  code: RATE_LIMIT_ERROR
                  message: You can only make 100 requests per second
                  status: 429
        '500':
          description: Internal server error
          content:
            application/json:
              examples:
                error:
                  summary: Internal server error
                  value:
                    code: UNKNOWN_ERROR
                    message: Internal server error
                    status: 500
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: UNKNOWN_ERROR
                  message:
                    type: string
                    example: Internal server error
                  status:
                    type: integer
                    example: 500
                example:
                  code: UNKNOWN_ERROR
                  message: Internal server error
                  status: 500
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: typescript
          label: TypeScript
          source: |-
            import { PeriskopeApi } from '@periskope/periskope-client';

            const client = new PeriskopeApi({
              authToken: 'YOUR_API_KEY',
            });

            async function main() {
              const response = await client.knowledgeBase.listKnowledgeBase();
              console.log(response);
            }

            main();
        - lang: bash
          label: cURL
          source: |-
            curl -X GET 'https://api.periskope.app/v1/knowledge-base' \
              -H 'Authorization: Bearer YOUR_API_KEY'
components:
  schemas:
    KnowledgeBaseContext:
      type: object
      properties:
        context_id:
          type: string
          description: >-
            Unique id of the knowledge-base entry. For FAQs, this is the id to
            use with the GET/PATCH/DELETE /knowledge-base/faq/{context_id}
            routes. Each chunk of an uploaded document has its own context_id.
          example: 00000000-0000-0000-0000-000000000000
        org_id:
          type: string
          description: Id of the organization the entry belongs to
          example: 00000000-0000-0000-0000-000000000000
        question:
          type: string
          description: >-
            The question the entry answers. For document chunks this is a
            derived heading — the document title plus the detected section or
            question (e.g. "product-faq — Pricing").
          example: What is Periskope?
        answer:
          type: string
          description: >-
            The answer text the AI agent draws on. For document chunks, the
            extracted text of the chunk.
          example: Periskope is a platform to manage WhatsApp at scale.
        type:
          type: string
          enum:
            - faq
            - document
            - self-learned
          description: >-
            Kind of entry: 'faq' for question/answer pairs created via the API
            or dashboard, 'document' for chunks extracted from uploaded PDF
            documents, 'self-learned' for entries the AI agent captured
            automatically from conversations.
          example: faq
        embedding:
          type: string
          description: >-
            Vector embedding of the entry, serialized as a string. Used
            internally for semantic retrieval — safe to ignore.
          example: '[-0.0123,0.0456,0.0789,...]'
        attachments:
          description: >-
            Attachments stored on the entry — for FAQs created with an
            attachment, an array of { link: { url, type, name } } objects
            pointing at the stored file. null or an empty array when the entry
            has no attachments.
          example:
            - link:
                url: >-
                  org-assets/00000000-0000-0000-0000-000000000000/ai_assets/00000000-0000-0000-0000-000000000000/pricing.pdf
                type: application/pdf
                name: pricing.pdf
        avg_rating:
          type: number
          description: >-
            Average rating of AI answers generated from this entry. null when
            the entry has not been rated.
          example: null
        document_id:
          type: string
          description: >-
            Id of the uploaded document a chunk belongs to — use it with the
            GET/DELETE /knowledge-base/document/{document_id} routes. null for
            FAQs and self-learned entries.
          example: 00000000-0000-0000-0000-000000000000
        is_active:
          type: boolean
          description: >-
            Whether the entry is currently used by the AI agent when answering.
            Entries created via the API start inactive unless is_active is sent
            as true.
          example: true
        metadata:
          description: >-
            Extra metadata about the entry. For document chunks: fileName,
            filePath, chunkIndex, tokenCount and the extraction source ('qa' for
            detected Q&A pairs, 'paragraph' for paragraph blocks, 'text' for
            sentence windows). null for FAQs.
          example:
            fileName: product-faq.pdf
            chunkIndex: 1
            tokenCount: 180
            source: qa
        tags:
          type: array
          items:
            type: string
          description: Tags assigned to the entry. null when untagged.
          example: null
        created_at:
          type: string
          description: When the entry was created, as an ISO 8601 timestamp
          example: '2026-01-15T09:30:00.000Z'
        updated_at:
          type: string
          description: >-
            When the entry was last updated, as an ISO 8601 timestamp. null when
            never updated.
          example: '2026-01-15T09:30:00.000Z'
      description: >-
        An entry in the AI knowledge base — the content the AI agent draws on
        when answering queries. An entry is either an FAQ (a question/answer
        pair), one chunk of an uploaded PDF document, or a self-learned entry
        captured automatically from conversations.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your Periskope API token, sent as `Authorization: Bearer <token>`.
        Generate one from the Periskope dashboard under **Settings → API &
        Webhooks**. API access requires an active Pro or Enterprise plan.

````

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