Skip to main content
POST
Files
Read files from OneDrive and SharePoint through a connection. List GET /v1/connections and choose connection_id by system and account_label. The connection uses the signed-in user’s Microsoft 365 permissions. Search covers accessible OneDrive and SharePoint files.

Search files

POST /v1/tools/files/search (files_search) requires connection_id and a non-empty query. Optional folder_id restricts search recursively to that folder. limit defaults to 25 and must be between 1 and 50. Pass the previous next_cursor as cursor with the same filters. Search follows the Microsoft 365 index, so new or moved files may take time to appear.
The response contains data.records, data.receipt_id, and data.next_cursor when another page exists. Each record has id, name, path, content_type, size, modified_at and source (system, id). Unavailable descriptive fields are null. Folders are omitted, so a page may contain fewer than limit files; continue while a cursor is present. IDs are opaque: pass them unchanged. They retain the location of a file in another drive or a SharePoint library without requiring extra parameters. A folder identifier can be a connected drive’s raw item ID or an encoded drive/item reference in the same format as returned file IDs.

Read a file

POST /v1/tools/files/read (files_read) takes connection_id and file_id from the search results. It returns name, content_type, size and base64 inside data, alongside receipt_id. Content is limited to 10 MB (10,485,760 bytes). Missing, invalid or oversized metadata refuses before payment. Downloads are bounded while streaming and only use Microsoft 365 tenant download endpoints, without following redirects. A file that changes size or fails to download after payment is refused and refunded as account credit. These tools never write or modify files. File metadata and bytes pass through the answer and are never saved in logs, receipts, jobs or goal history. A later goal step must read the file again. Invalid inputs return 400 invalid_request, unsupported sizes return 400 not_supported, another agent’s connection returns 404 connection_not_found, and revoked or expired connections return 409. Unavailable file data returns 503. Payment uses x402 or account credit; amounts are on Pricing.