curl --request POST \
--url https://api.recursion.labelbox.com/managed-agents/v1/sessions/{session_id}/resources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"resources": [
{
"file_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",
"mount_path": "example",
"relative_path": "example",
"type": "file"
}
]
}
'import requests
url = "https://api.recursion.labelbox.com/managed-agents/v1/sessions/{session_id}/resources"
payload = { "resources": [
{
"file_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",
"mount_path": "example",
"relative_path": "example",
"type": "file"
}
] }
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({
resources: [
{
file_id: '9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d',
mount_path: 'example',
relative_path: 'example',
type: 'file'
}
]
})
};
fetch('https://api.recursion.labelbox.com/managed-agents/v1/sessions/{session_id}/resources', 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/sessions/{session_id}/resources",
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([
'resources' => [
[
'file_id' => '9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d',
'mount_path' => 'example',
'relative_path' => 'example',
'type' => 'file'
]
]
]),
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/sessions/{session_id}/resources"
payload := strings.NewReader("{\n \"resources\": [\n {\n \"file_id\": \"9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d\",\n \"mount_path\": \"example\",\n \"relative_path\": \"example\",\n \"type\": \"file\"\n }\n ]\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/sessions/{session_id}/resources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resources\": [\n {\n \"file_id\": \"9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d\",\n \"mount_path\": \"example\",\n \"relative_path\": \"example\",\n \"type\": \"file\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recursion.labelbox.com/managed-agents/v1/sessions/{session_id}/resources")
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 \"resources\": [\n {\n \"file_id\": \"9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d\",\n \"mount_path\": \"example\",\n \"relative_path\": \"example\",\n \"type\": \"file\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"resources": [
{
"byte_size": 1,
"created_at": "2026-02-18T09:30:00.000Z",
"file_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",
"filename": "example",
"media_type": "example",
"mount_path": "example",
"relative_path": "example",
"resource_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",
"sha256": "example",
"type": "file"
}
]
}{
"code": "analytics",
"message": "<string>",
"details": {}
}{
"code": "analytics",
"message": "<string>",
"details": {}
}{
"code": "forbidden",
"message": "<string>",
"details": {}
}{
"code": "analytics",
"message": "<string>",
"details": {}
}{
"code": "analytics",
"message": "<string>",
"details": {}
}{
"code": "analytics",
"message": "<string>",
"details": {}
}{
"code": "unsupported_media_type",
"message": "<string>",
"details": {}
}{
"code": "analytics",
"message": "<string>",
"details": {}
}{
"code": "analytics",
"message": "<string>",
"details": {}
}{
"code": "bad_gateway",
"message": "<string>",
"details": {}
}{
"code": "analytics",
"message": "<string>",
"details": {}
}{
"code": "gateway_timeout",
"message": "<string>",
"details": {}
}Attach files to a running session
Attaches files to the session. Each attaches the file’s content as it is now, is placed in the sandbox on the session’s next tool call, and is visible to the agent from its next turn under the session’s files directory. All-or-nothing: one unknown file_id answers 404 and one path colliding with, or nesting inside, another’s answers 409, and nothing is attached either way. A member session of a multi-agent tree answers 409: files are attached to its root. A completed, failed, or cancelled root session is accepted, and its next message resumes it with the file already staged.
curl --request POST \
--url https://api.recursion.labelbox.com/managed-agents/v1/sessions/{session_id}/resources \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"resources": [
{
"file_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",
"mount_path": "example",
"relative_path": "example",
"type": "file"
}
]
}
'import requests
url = "https://api.recursion.labelbox.com/managed-agents/v1/sessions/{session_id}/resources"
payload = { "resources": [
{
"file_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",
"mount_path": "example",
"relative_path": "example",
"type": "file"
}
] }
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({
resources: [
{
file_id: '9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d',
mount_path: 'example',
relative_path: 'example',
type: 'file'
}
]
})
};
fetch('https://api.recursion.labelbox.com/managed-agents/v1/sessions/{session_id}/resources', 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/sessions/{session_id}/resources",
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([
'resources' => [
[
'file_id' => '9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d',
'mount_path' => 'example',
'relative_path' => 'example',
'type' => 'file'
]
]
]),
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/sessions/{session_id}/resources"
payload := strings.NewReader("{\n \"resources\": [\n {\n \"file_id\": \"9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d\",\n \"mount_path\": \"example\",\n \"relative_path\": \"example\",\n \"type\": \"file\"\n }\n ]\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/sessions/{session_id}/resources")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"resources\": [\n {\n \"file_id\": \"9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d\",\n \"mount_path\": \"example\",\n \"relative_path\": \"example\",\n \"type\": \"file\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.recursion.labelbox.com/managed-agents/v1/sessions/{session_id}/resources")
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 \"resources\": [\n {\n \"file_id\": \"9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d\",\n \"mount_path\": \"example\",\n \"relative_path\": \"example\",\n \"type\": \"file\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"resources": [
{
"byte_size": 1,
"created_at": "2026-02-18T09:30:00.000Z",
"file_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",
"filename": "example",
"media_type": "example",
"mount_path": "example",
"relative_path": "example",
"resource_id": "9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d",
"sha256": "example",
"type": "file"
}
]
}{
"code": "analytics",
"message": "<string>",
"details": {}
}{
"code": "analytics",
"message": "<string>",
"details": {}
}{
"code": "forbidden",
"message": "<string>",
"details": {}
}{
"code": "analytics",
"message": "<string>",
"details": {}
}{
"code": "analytics",
"message": "<string>",
"details": {}
}{
"code": "analytics",
"message": "<string>",
"details": {}
}{
"code": "unsupported_media_type",
"message": "<string>",
"details": {}
}{
"code": "analytics",
"message": "<string>",
"details": {}
}{
"code": "analytics",
"message": "<string>",
"details": {}
}{
"code": "bad_gateway",
"message": "<string>",
"details": {}
}{
"code": "analytics",
"message": "<string>",
"details": {}
}{
"code": "gateway_timeout",
"message": "<string>",
"details": {}
}Authorizations
A Recursion API key, created in the console under API keys.
Path Parameters
Session id (UUID) as returned by startSession or listSessions.
Body
Request body for attaching files to a running session. The files are staged into the sandbox on the session's next tool call and are visible to the agent from its next turn.
Files to attach. All-or-nothing: one unknown file_id or one path collision refuses the whole batch and attaches nothing.
1 - 500 elementsShow child attributes
Show child attributes
Response
Response body of GET and POST /v1/sessions/{session_id}/resources. A POST returns only the resources it attached.
Response body of GET and POST /v1/sessions/{session_id}/resources. A POST returns only the resources it attached.
Every file attached to the session, in attachment order, each with its sandbox path once staged.
Show child attributes
Show child attributes