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

# Get one document

> Returns one document with its words as stored (null for a file that isn't text, such as a PDF). A document is indexed in the background after it arrives or changes: `status` is queued, indexing, ready or failed (`error` says why), and `searchable` whether a search finds it (a document being indexed again keeps answering from its previous version). `url` is the link a worker gives a customer when it answers from it. A document with an `account_id` is left out when a worker answers another account; a search for no account in particular (a worker going over its whole book, or `knowledge_bases.search` without `account`) includes it.



## OpenAPI

````yaml /api/statisfy-api.openapi.json get /v1/knowledge_bases/{knowledge_base_id}/documents/{document_id}
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/knowledge_bases/{knowledge_base_id}/documents/{document_id}:
    get:
      tags:
        - knowledge_bases
      summary: Get one document
      description: >-
        Returns one document with its words as stored (null for a file that
        isn't text, such as a PDF). A document is indexed in the background
        after it arrives or changes: `status` is queued, indexing, ready or
        failed (`error` says why), and `searchable` whether a search finds it (a
        document being indexed again keeps answering from its previous version).
        `url` is the link a worker gives a customer when it answers from it. A
        document with an `account_id` is left out when a worker answers another
        account; a search for no account in particular (a worker going over its
        whole book, or `knowledge_bases.search` without `account`) includes it.
      operationId: knowledge_bases_get_document
      parameters:
        - description: The knowledge base's id, from GET /v1/knowledge_bases
          in: path
          name: knowledge_base_id
          required: true
          schema:
            type: string
        - description: >-
            The document's id, from GET
            /v1/knowledge_bases/{knowledge_base_id}/documents
          in: path
          name: document_id
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeDocumentDetail'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    KnowledgeDocumentDetail:
      properties:
        account_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Set when the document is filed for one account (from GET
            /v1/objects/account/records): a worker answering that account
            searches it, one answering another account does not. Null: searched
            for every account
          title: Account Id
        content:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Its words as stored (HTML for a page or a help-center article,
            Markdown or plain text). Null for a file that isn't text (a PDF, a
            Word file, a spreadsheet), and for a document whose stored file is
            gone
          title: Content
        created_at:
          description: ISO 8601 UTC
          title: Created At
          type: string
        error:
          anyOf:
            - type: string
            - type: 'null'
          description: Why indexing failed; null unless status is failed
          title: Error
        external_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Your id for a document you pushed through this API; null for an
            upload or a connector's
          title: External Id
        format:
          description: >-
            Its file's type: pdf, docx or doc (an uploaded file); text, markdown
            or html; or another type a connector stored, such as a SharePoint
            spreadsheet or slides (xlsx, xls, pptx, ppt), which isn't indexed
          title: Format
          type: string
        id:
          title: Id
          type: string
        knowledge_base_id:
          title: Knowledge Base Id
          type: string
        searchable:
          description: >-
            Whether a search finds it: true once a version is indexed, and while
            a newer version is queued, indexing or failed the previous one keeps
            answering
          title: Searchable
          type: boolean
        source:
          description: >-
            Its knowledge base's source: Where its documents come from: api
            (pushed through this API), upload (files uploaded in the app),
            team_answers (articles the team approved in the app), or the
            connector that syncs it (intercom, zendesk, notion, google_drive,
            sharepoint, website)
          title: Source
          type: string
        source_url:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Where its connector found it (a help-center article, a page, a
            file); null otherwise
          title: Source Url
        status:
          description: >-
            queued (waiting to be indexed), indexing, ready, or failed (see
            error): how its latest version stands. `searchable` says whether a
            search finds it
          enum:
            - queued
            - indexing
            - ready
            - failed
          title: Status
          type: string
        title:
          description: >-
            Its title: a file's name for an upload, the page's or article's
            title otherwise
          title: Title
          type: string
        updated_at:
          description: 'ISO 8601 UTC: when its words or details last changed'
          title: Updated At
          type: string
        url:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            The link a worker gives a customer when it answers from this
            document; null when it has none, and the worker then names it
            without a link
          title: Url
      required:
        - id
        - knowledge_base_id
        - title
        - format
        - source
        - status
        - searchable
        - created_at
        - updated_at
      title: KnowledgeDocumentDetail
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

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