curl --request POST \
--url https://api.recursion.labelbox.com/managed-agents/v1/agents/{agentId}/files/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cursor": "<string>",
"filter": {
"createdAt": {
"gte": "2023-11-07T05:31:56Z",
"lt": "2023-11-07T05:31:56Z"
},
"filenamePrefix": "<string>",
"mediaTypes": [
"<string>"
],
"metadata": [
{
"key": "<string>",
"value": true
}
],
"pathPrefix": "<string>",
"rootSessionIds": [
"<string>"
]
},
"limit": 20,
"sort": "created_at_desc",
"strictContent": false,
"text": "<string>"
}
'import requests
url = "https://api.recursion.labelbox.com/managed-agents/v1/agents/{agentId}/files/search"
payload = {
"cursor": "<string>",
"filter": {
"createdAt": {
"gte": "2023-11-07T05:31:56Z",
"lt": "2023-11-07T05:31:56Z"
},
"filenamePrefix": "<string>",
"mediaTypes": ["<string>"],
"metadata": [
{
"key": "<string>",
"value": True
}
],
"pathPrefix": "<string>",
"rootSessionIds": ["<string>"]
},
"limit": 20,
"sort": "created_at_desc",
"strictContent": False,
"text": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cursor: '<string>',
filter: {
createdAt: {gte: '2023-11-07T05:31:56Z', lt: '2023-11-07T05:31:56Z'},
filenamePrefix: '<string>',
mediaTypes: ['<string>'],
metadata: [{key: '<string>', value: true}],
pathPrefix: '<string>',
rootSessionIds: ['<string>']
},
limit: 20,
sort: 'created_at_desc',
strictContent: false,
text: '<string>'
})
};
fetch('https://api.recursion.labelbox.com/managed-agents/v1/agents/{agentId}/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://api.recursion.labelbox.com/managed-agents/v1/agents/{agentId}/files/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cursor' => '<string>',
'filter' => [
'createdAt' => [
'gte' => '2023-11-07T05:31:56Z',
'lt' => '2023-11-07T05:31:56Z'
],
'filenamePrefix' => '<string>',
'mediaTypes' => [
'<string>'
],
'metadata' => [
[
'key' => '<string>',
'value' => true
]
],
'pathPrefix' => '<string>',
'rootSessionIds' => [
'<string>'
]
],
'limit' => 20,
'sort' => 'created_at_desc',
'strictContent' => false,
'text' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.recursion.labelbox.com/managed-agents/v1/agents/{agentId}/files/search"
payload := strings.NewReader("{\n \"cursor\": \"<string>\",\n \"filter\": {\n \"createdAt\": {\n \"gte\": \"2023-11-07T05:31:56Z\",\n \"lt\": \"2023-11-07T05:31:56Z\"\n },\n \"filenamePrefix\": \"<string>\",\n \"mediaTypes\": [\n \"<string>\"\n ],\n \"metadata\": [\n {\n \"key\": \"<string>\",\n \"value\": true\n }\n ],\n \"pathPrefix\": \"<string>\",\n \"rootSessionIds\": [\n \"<string>\"\n ]\n },\n \"limit\": 20,\n \"sort\": \"created_at_desc\",\n \"strictContent\": false,\n \"text\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.recursion.labelbox.com/managed-agents/v1/agents/{agentId}/files/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cursor\": \"<string>\",\n \"filter\": {\n \"createdAt\": {\n \"gte\": \"2023-11-07T05:31:56Z\",\n \"lt\": \"2023-11-07T05:31:56Z\"\n },\n \"filenamePrefix\": \"<string>\",\n \"mediaTypes\": [\n \"<string>\"\n ],\n \"metadata\": [\n {\n \"key\": \"<string>\",\n \"value\": true\n }\n ],\n \"pathPrefix\": \"<string>\",\n \"rootSessionIds\": [\n \"<string>\"\n ]\n },\n \"limit\": 20,\n \"sort\": \"created_at_desc\",\n \"strictContent\": false,\n \"text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recursion.labelbox.com/managed-agents/v1/agents/{agentId}/files/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cursor\": \"<string>\",\n \"filter\": {\n \"createdAt\": {\n \"gte\": \"2023-11-07T05:31:56Z\",\n \"lt\": \"2023-11-07T05:31:56Z\"\n },\n \"filenamePrefix\": \"<string>\",\n \"mediaTypes\": [\n \"<string>\"\n ],\n \"metadata\": [\n {\n \"key\": \"<string>\",\n \"value\": true\n }\n ],\n \"pathPrefix\": \"<string>\",\n \"rootSessionIds\": [\n \"<string>\"\n ]\n },\n \"limit\": 20,\n \"sort\": \"created_at_desc\",\n \"strictContent\": false,\n \"text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"asOf": "2023-11-07T05:31:56Z",
"coverage": {
"content": "complete",
"metadata": "complete",
"missing": 0,
"partial": 0,
"unsupported": 0
},
"items": [
{
"byteSize": 0,
"contentState": "indexed",
"createdAt": "2023-11-07T05:31:56Z",
"fileId": "<string>",
"filename": "<string>",
"mediaType": "<string>",
"ownerAgentId": "<string>",
"path": "<string>",
"rootSessionId": "<string>",
"sha256": "<string>",
"metadata": {},
"producerAgentVersionId": "<string>",
"producerSessionId": "<string>",
"snippet": "<string>"
}
],
"nextCursor": "<string>",
"total": 4503599627370495
}{
"code": "invalid_json",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "unauthorized",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "forbidden",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "not_found",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "payload_too_large",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "unsupported_media_type",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "content_index_incomplete",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "rate_limit_exceeded",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "internal_error",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "bad_gateway",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "managed_agents_unavailable",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "gateway_timeout",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}Search an agent's file history
Searches the session outputs this agent’s sessions saved, including outputs its subagents and teammates saved, which are what its sessions read with search_agent_files when the agent has fileHistoryEnabled. Structured and metadata conditions are exact and apply before paging; text searches the contents of text formats, and coverage reports the candidates it could not search in full. Every page reads the snapshot asOf names; pass nextCursor back with an otherwise unchanged request for the next page. Outputs of deleted sessions, of session analysts, and of sessions under an access policy are not included.
curl --request POST \
--url https://api.recursion.labelbox.com/managed-agents/v1/agents/{agentId}/files/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cursor": "<string>",
"filter": {
"createdAt": {
"gte": "2023-11-07T05:31:56Z",
"lt": "2023-11-07T05:31:56Z"
},
"filenamePrefix": "<string>",
"mediaTypes": [
"<string>"
],
"metadata": [
{
"key": "<string>",
"value": true
}
],
"pathPrefix": "<string>",
"rootSessionIds": [
"<string>"
]
},
"limit": 20,
"sort": "created_at_desc",
"strictContent": false,
"text": "<string>"
}
'import requests
url = "https://api.recursion.labelbox.com/managed-agents/v1/agents/{agentId}/files/search"
payload = {
"cursor": "<string>",
"filter": {
"createdAt": {
"gte": "2023-11-07T05:31:56Z",
"lt": "2023-11-07T05:31:56Z"
},
"filenamePrefix": "<string>",
"mediaTypes": ["<string>"],
"metadata": [
{
"key": "<string>",
"value": True
}
],
"pathPrefix": "<string>",
"rootSessionIds": ["<string>"]
},
"limit": 20,
"sort": "created_at_desc",
"strictContent": False,
"text": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
cursor: '<string>',
filter: {
createdAt: {gte: '2023-11-07T05:31:56Z', lt: '2023-11-07T05:31:56Z'},
filenamePrefix: '<string>',
mediaTypes: ['<string>'],
metadata: [{key: '<string>', value: true}],
pathPrefix: '<string>',
rootSessionIds: ['<string>']
},
limit: 20,
sort: 'created_at_desc',
strictContent: false,
text: '<string>'
})
};
fetch('https://api.recursion.labelbox.com/managed-agents/v1/agents/{agentId}/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://api.recursion.labelbox.com/managed-agents/v1/agents/{agentId}/files/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'cursor' => '<string>',
'filter' => [
'createdAt' => [
'gte' => '2023-11-07T05:31:56Z',
'lt' => '2023-11-07T05:31:56Z'
],
'filenamePrefix' => '<string>',
'mediaTypes' => [
'<string>'
],
'metadata' => [
[
'key' => '<string>',
'value' => true
]
],
'pathPrefix' => '<string>',
'rootSessionIds' => [
'<string>'
]
],
'limit' => 20,
'sort' => 'created_at_desc',
'strictContent' => false,
'text' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.recursion.labelbox.com/managed-agents/v1/agents/{agentId}/files/search"
payload := strings.NewReader("{\n \"cursor\": \"<string>\",\n \"filter\": {\n \"createdAt\": {\n \"gte\": \"2023-11-07T05:31:56Z\",\n \"lt\": \"2023-11-07T05:31:56Z\"\n },\n \"filenamePrefix\": \"<string>\",\n \"mediaTypes\": [\n \"<string>\"\n ],\n \"metadata\": [\n {\n \"key\": \"<string>\",\n \"value\": true\n }\n ],\n \"pathPrefix\": \"<string>\",\n \"rootSessionIds\": [\n \"<string>\"\n ]\n },\n \"limit\": 20,\n \"sort\": \"created_at_desc\",\n \"strictContent\": false,\n \"text\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.recursion.labelbox.com/managed-agents/v1/agents/{agentId}/files/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cursor\": \"<string>\",\n \"filter\": {\n \"createdAt\": {\n \"gte\": \"2023-11-07T05:31:56Z\",\n \"lt\": \"2023-11-07T05:31:56Z\"\n },\n \"filenamePrefix\": \"<string>\",\n \"mediaTypes\": [\n \"<string>\"\n ],\n \"metadata\": [\n {\n \"key\": \"<string>\",\n \"value\": true\n }\n ],\n \"pathPrefix\": \"<string>\",\n \"rootSessionIds\": [\n \"<string>\"\n ]\n },\n \"limit\": 20,\n \"sort\": \"created_at_desc\",\n \"strictContent\": false,\n \"text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recursion.labelbox.com/managed-agents/v1/agents/{agentId}/files/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"cursor\": \"<string>\",\n \"filter\": {\n \"createdAt\": {\n \"gte\": \"2023-11-07T05:31:56Z\",\n \"lt\": \"2023-11-07T05:31:56Z\"\n },\n \"filenamePrefix\": \"<string>\",\n \"mediaTypes\": [\n \"<string>\"\n ],\n \"metadata\": [\n {\n \"key\": \"<string>\",\n \"value\": true\n }\n ],\n \"pathPrefix\": \"<string>\",\n \"rootSessionIds\": [\n \"<string>\"\n ]\n },\n \"limit\": 20,\n \"sort\": \"created_at_desc\",\n \"strictContent\": false,\n \"text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"asOf": "2023-11-07T05:31:56Z",
"coverage": {
"content": "complete",
"metadata": "complete",
"missing": 0,
"partial": 0,
"unsupported": 0
},
"items": [
{
"byteSize": 0,
"contentState": "indexed",
"createdAt": "2023-11-07T05:31:56Z",
"fileId": "<string>",
"filename": "<string>",
"mediaType": "<string>",
"ownerAgentId": "<string>",
"path": "<string>",
"rootSessionId": "<string>",
"sha256": "<string>",
"metadata": {},
"producerAgentVersionId": "<string>",
"producerSessionId": "<string>",
"snippet": "<string>"
}
],
"nextCursor": "<string>",
"total": 4503599627370495
}{
"code": "invalid_json",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "unauthorized",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "forbidden",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "not_found",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "payload_too_large",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "unsupported_media_type",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "content_index_incomplete",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "rate_limit_exceeded",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "internal_error",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "bad_gateway",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "managed_agents_unavailable",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}{
"code": "gateway_timeout",
"message": "<string>",
"details": {
"field": "<string>",
"issues": [
"<string>"
],
"requestId": "<string>",
"retryable": true
}
}Authorizations
A Recursion API key, created in the console under API keys.
Headers
Optional tenant consistency check. When present, it must name the tenant bound to the API key, including when x-organization-id is default.
1Organization in which to act. Required for a tenant-scoped API key. Optional for an organization-scoped key, where it must name that same organization. The value may be an organization id or default.
1Path Parameters
Agent id (UUID) as returned by managedAgentsCreateAgent or managedAgentsListAgents.
Body
nextCursor from the previous page. The rest of the request must be unchanged.
Structured conditions. Omit to browse.
Show child attributes
Show child attributes
Page size, default 20.
1 <= x <= 100created_at_desc (default) lists newest first; relevance ranks by text match and needs text.
created_at_desc, relevance Fail with content_index_incomplete instead of returning results when some candidate files could not be text-searched.
Words to find in the text of the files. All words must appear; a quoted "phrase" must appear as written; OR between words matches either; -word excludes. Only text formats are searched, and coverage says what was not.
Response
One page of an agent file search: the session outputs this agent's earlier sessions saved that match, with a cursor for the next page and the coverage of text search.
One page of an agent file search: the session outputs this agent's earlier sessions saved that match, with a cursor for the next page and the coverage of text search.
The snapshot every page of this search reads: files saved after it are not included.
How completely the search covered the eligible files.
Show child attributes
Show child attributes
Matching files, in the requested order.
Show child attributes
Show child attributes
Opaque cursor for the next page, passed back unchanged with the same request; null on the last page.
Exact number of files matching every condition in this search's snapshot.
0 <= x <= 9007199254740991