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

# Get a document

> Resolve a document id, such as the one in a <cite document_id="..."/> tag of an answer, to its source and file. The id is the source id, a #, and the document's own identifier, so URL-encode it. There is no list: an unknown id returns 404 Not Found.



## OpenAPI

````yaml /openapi.json get /documents
openapi: 3.1.0
info:
  title: Cominty API
  description: >-
    The HTTP API behind the Cominty Python SDK: chat and threads, memory, MCP
    integrations, agents, skills, document sources, and documents. Send your API
    key in the x-cominty-token header.
  version: main.5359267
servers:
  - url: https://ds.cominty.com
security:
  - comintyToken: []
paths:
  /documents:
    get:
      tags:
        - documents
      summary: Get a document
      description: >-
        Resolve a document id, such as the one in a <cite document_id="..."/>
        tag of an answer, to its source and file. The id is the source id, a #,
        and the document's own identifier, so URL-encode it. There is no list:
        an unknown id returns 404 Not Found.
      operationId: get_document_metadata_by_query_documents_get
      parameters:
        - name: id
          in: query
          required: true
          schema:
            type: string
            description: Composite document id stored in DynamoDB (may contain `#`).
            title: Id
          description: Composite document id stored in DynamoDB (may contain `#`).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentMetadataOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DocumentMetadataOut:
      properties:
        document_id:
          type: string
          title: Document Id
          description: 'Source id, a #, and the document''s own identifier.'
        source_id:
          type: integer
          title: Source Id
          description: Numeric id of the source. Use it in source_ids.
        document_name:
          type: string
          title: Document Name
        document_uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Uri
          description: >-
            Link to the document. null when there is none. For a drag-and-drop
            source it ends with the file id.
        source_pid:
          type: string
          title: Source Pid
          description: Public id of the source. Use it in paths.
        source_type:
          $ref: '#/components/schemas/SupportedDocumentStore'
        document_extension:
          type: string
          title: Document Extension
        document_mime_type:
          type: string
          title: Document Mime Type
      additionalProperties: false
      type: object
      required:
        - document_id
        - source_id
        - document_name
        - document_uri
        - source_pid
        - source_type
        - document_extension
        - document_mime_type
      title: DocumentMetadataOut
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SupportedDocumentStore:
      type: string
      enum:
        - googledrive
        - sharepoint
        - draganddrop
      title: SupportedDocumentStore
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    comintyToken:
      type: apiKey
      in: header
      name: x-cominty-token
      description: >-
        A Cominty Platform API secret. A key created now starts with sk-cmt-.
        Send it as is, or as Bearer sk-cmt-..., with at most one Bearer prefix.
        A key created before the prefix existed has no sk-cmt- and still works.

````

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