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

# Extract File Content

> Extract text content from supported file types.

Extracts text content from files with supported MIME types including `text/*`, `application/json`, and `text/csv`.

## Path Parameters

<ParamField path="id" type="string" required>
  The unique identifier of the file to extract content from.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.getagentdrive.com/v0/files/file_xyz789/extract \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "content": "Annual Report 2026\n\nExecutive Summary\nThis report covers the fiscal year...",
    "mime_type": "text/plain"
  }
  ```
</ResponseExample>

<ResponseExample>
  ```json 200 JSON file theme={null}
  {
    "content": {
      "name": "config",
      "version": "1.0",
      "settings": { "debug": false }
    },
    "mime_type": "application/json"
  }
  ```
</ResponseExample>

## Response

<ResponseField name="content" type="string | object">
  The extracted content. Returns a string for text files and a parsed object for JSON files.
</ResponseField>

<ResponseField name="mime_type" type="string">
  The MIME type of the extracted content.
</ResponseField>
