---
title: "Search user's OneDrive files"
method: GET
path: "/api/v1/onedrive/search"
---

# Search user's OneDrive files

`GET /api/v1/onedrive/search`

## Request

- Base URL: `https://localhost:3000`
- URL: `https://localhost:3000/api/v1/onedrive/search`
- Auth: OAuth 2 (authorization code, authorization URL `/oauth/authorize`, token URL `/oauth/token`)

AUTHORITATIVE: Search the authenticated user's LIVE OneDrive files by name or content. Use when user asks 'find my OneDrive file about X', 'search my OneDrive for Y'. Returns real results from user's actual OneDrive. **NOTE:** Requires Microsoft authentication via /oauth/microsoft/authorize.

## Query parameters

- `query` string, required
- `max_results` integer
- `page_token` string

## Response `200`

Search results from OneDrive

- OneDriveSearchResponse
  - `user` string
  - `query` string: The search query used
  - `files` OneDriveFile[]
    - `id` string: OneDrive file ID
    - `name` string: File name
    - `mimeType` string: MIME type of the file
    - `webUrl` string: Link to view the file in browser
    - `lastModifiedDateTime` string, date-time: Last modified timestamp
    - `size` integer: File size in bytes
    - `parentReference` object
      - `driveId` string
      - `id` string
      - `path` string
    - `folder` object: Present if item is a folder
      - `childCount` integer
  - `count` integer
  - `nextPageToken` string
  - `hasMore` boolean
  - `_meta` object
    - `source` string
    - `authoritative` boolean

## Other responses

- `401`: Authentication required
- `500`: Internal server error
- `503`: OneDrive not authenticated. User must authenticate at /oauth/microsoft/authorize

---

[API](https://skmtc.dev/corpusiq/apis/multi-source-mcp-api.md) · [All operations](https://skmtc.dev/corpusiq/apis/multi-source-mcp-api/llms.txt) · [OpenAPI document](https://skmtc.dev/corpusiq/apis/multi-source-mcp-api/revisions/e25648ba6027?raw)
