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

# Get RAG Document

> Retrieves detailed information about a specific document

## Path Parameters

<ParamField path="id" type="string" required>
  Document ID
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the request was successful
</ResponseField>

<ResponseField name="document" type="object | null">
  Document details or null if not found

  <Expandable title="Document Object">
    <ResponseField name="id" type="string">
      Document ID
    </ResponseField>

    <ResponseField name="projectId" type="string">
      Associated project ID
    </ResponseField>

    <ResponseField name="fileId" type="string | null">
      Associated file ID if applicable
    </ResponseField>

    <ResponseField name="fileName" type="string">
      Document file name
    </ResponseField>

    <ResponseField name="fileType" type="string">
      File type (pdf, txt, md, etc.)
    </ResponseField>

    <ResponseField name="sourceType" type="string">
      Source type (upload, url, integration)
    </ResponseField>

    <ResponseField name="status" type="string">
      Processing status: pending, processing, completed, or failed
    </ResponseField>

    <ResponseField name="chunkCount" type="number">
      Number of chunks created from this document
    </ResponseField>

    <ResponseField name="vectorCount" type="number">
      Number of vectors stored
    </ResponseField>

    <ResponseField name="error" type="string | null">
      Error message if status is failed
    </ResponseField>

    <ResponseField name="metadata" type="object">
      Additional document metadata
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      ISO 8601 timestamp of creation
    </ResponseField>

    <ResponseField name="updatedAt" type="string">
      ISO 8601 timestamp of last update
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://api.example.com/api/knowledge/documents/doc_abc123 \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.example.com/api/knowledge/documents/doc_abc123',
    {
      method: 'GET',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY'
      }
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.example.com/api/knowledge/documents/doc_abc123',
      headers={'Authorization': 'Bearer YOUR_API_KEY'}
  )

  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true,
    "document": {
      "id": "doc_abc123",
      "projectId": "proj_123",
      "fileId": "file_xyz789",
      "fileName": "product-guide.pdf",
      "fileType": "pdf",
      "sourceType": "upload",
      "status": "completed",
      "chunkCount": 45,
      "vectorCount": 45,
      "error": null,
      "metadata": {
        "size": 2048576,
        "pages": 23,
        "language": "en"
      },
      "createdAt": "2026-01-15T10:30:00Z",
      "updatedAt": "2026-01-15T10:35:00Z"
    }
  }
  ```

  ```json Not Found theme={null}
  {
    "success": false,
    "document": null
  }
  ```
</ResponseExample>
