> ## 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.

# Search Files

> Search for files across drives by name, tags, or MIME type.

## Query Parameters

<ParamField query="q" type="string" required>
  The search query string. Matches against file names and content previews.
</ParamField>

<ParamField query="drive_id" type="string">
  Limit the search to a specific drive.
</ParamField>

<ParamField query="tags" type="string">
  Filter by tags, specified as a comma-separated list (e.g., `report,2026`).
</ParamField>

<ParamField query="mime_type" type="string">
  Filter by MIME type. Supports wildcards (e.g., `image/*` to match all image types).
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.getagentdrive.com/v0/search?q=annual+report&tags=2026&mime_type=application/pdf" \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  [
    {
      "id": "file_xyz789",
      "drive_id": "drv_abc123",
      "path": "documents/report.pdf",
      "filename": "annual-report.pdf",
      "mime_type": "application/pdf",
      "size": 24576,
      "content_hash": "sha256:abcdef1234567890",
      "content_preview": "Annual Report 2026 - Executive Summary...",
      "tags": ["report", "2026"],
      "metadata": { "author": "Jane Doe" },
      "created_at": "2026-01-15T10:30:00Z",
      "updated_at": "2026-03-19T08:15:00Z"
    }
  ]
  ```
</ResponseExample>

## Response

Returns an array of file records matching the search criteria. See [Get File](/api-reference/files/get) for the full response schema.
