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

# Get Document Contents



## OpenAPI

````yaml api-reference/openapi.json get /datastores/{datastore_id}/contents
openapi: 3.1.0
info:
  title: Endpoints
  version: '1.0'
servers:
  - url: https://api.contextual.ai/v1
security:
  - BearerAuth: []
paths:
  /datastores/{datastore_id}/contents:
    get:
      tags:
        - /contents
      summary: Get Document Contents
      operationId: get_document_contents_datastores__datastore_id__contents_get
      parameters:
        - name: datastore_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: Datastore ID of the datastore from which to retrieve the document
            title: Datastore Id
          description: Datastore ID of the datastore from which to retrieve the document
        - name: document_id
          in: query
          required: false
          schema:
            type: string
            format: uuid
            description: Document ID of the document to retrieve details for
            title: Document Id
          description: Document ID of the document to retrieve details for
        - name: search
          in: query
          required: false
          schema:
            type: string
            description: The query to search keywords for
            title: Search
          description: The query to search keywords for
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            description: The offset to start retrieving content ids
            default: 0
            title: Offset
          description: The offset to start retrieving content ids
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            description: The number of content ids to be returned
            default: 50
            title: Limit
          description: The number of content ids to be returned
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListContentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ListContentResponse:
      properties:
        data:
          items:
            oneOf:
              - $ref: '#/components/schemas/DocumentContentEntry'
              - $ref: '#/components/schemas/StructuredContentEntry'
            description: Content entry type
            discriminator:
              propertyName: content_type
              mapping:
                structured:
                  $ref: '#/components/schemas/StructuredContentEntry'
                unstructured:
                  $ref: '#/components/schemas/DocumentContentEntry'
          type: array
          title: Data
          description: List of content entries
        has_more:
          type: boolean
          title: Has More
          description: Whether there are more content entries to retrieve
      type: object
      required:
        - data
        - has_more
      title: ListContentResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DocumentContentEntry:
      properties:
        content_id:
          type: string
          format: uuid
          title: Content Id
          description: ID of the content
        content_type:
          type: string
          const: unstructured
          title: Content Type
          default: unstructured
        page_number:
          type: integer
          title: Page Number
          description: Page number of the content
      type: object
      required:
        - content_id
        - page_number
      title: DocumentContentEntry
    StructuredContentEntry:
      properties:
        content_id:
          type: string
          title: Content Id
          description: ID of the content
        content_type:
          type: string
          const: structured
          title: Content Type
          default: structured
        table_name:
          type: string
          title: Table Name
          description: Name of the table
        schema:
          anyOf:
            - type: string
            - type: 'null'
          title: Schema
          description: Name of the schema of the table
      type: object
      required:
        - content_id
        - table_name
      title: StructuredContentEntry
      description: Tabular content entry used in query retrieval.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key

````