Files
curl --request POST \
--url https://win.oneshotagent.com/v1/tools/files/searchimport requests
url = "https://win.oneshotagent.com/v1/tools/files/search"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://win.oneshotagent.com/v1/tools/files/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://win.oneshotagent.com/v1/tools/files/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://win.oneshotagent.com/v1/tools/files/search"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://win.oneshotagent.com/v1/tools/files/search")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/v1/tools/files/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyConnections
Files
Search connected files and read bounded file content
POST
/
v1
/
tools
/
files
/
search
Files
curl --request POST \
--url https://win.oneshotagent.com/v1/tools/files/searchimport requests
url = "https://win.oneshotagent.com/v1/tools/files/search"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://win.oneshotagent.com/v1/tools/files/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://win.oneshotagent.com/v1/tools/files/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://win.oneshotagent.com/v1/tools/files/search"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://win.oneshotagent.com/v1/tools/files/search")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/v1/tools/files/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyRead files from OneDrive and SharePoint through a connection. List
The response contains
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.
{
"connection_id": "00000000-0000-4000-8000-000000000001",
"query": "bank statement",
"limit": 25
}
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.