curl --request POST \
--url https://api.timbal.ai/orgs/{org_id}/connectors/{connector_id}/filesystems/copy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filesystem_ref": "<string>",
"kb_id": 123,
"directory": "<string>",
"max_files": 1,
"max_total_bytes": 1,
"metadata": {},
"parse": true,
"path": "<string>",
"recursive": true
}
'import requests
url = "https://api.timbal.ai/orgs/{org_id}/connectors/{connector_id}/filesystems/copy"
payload = {
"filesystem_ref": "<string>",
"kb_id": 123,
"directory": "<string>",
"max_files": 1,
"max_total_bytes": 1,
"metadata": {},
"parse": True,
"path": "<string>",
"recursive": True
}
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({
filesystem_ref: '<string>',
kb_id: 123,
directory: '<string>',
max_files: 1,
max_total_bytes: 1,
metadata: {},
parse: true,
path: '<string>',
recursive: true
})
};
fetch('https://api.timbal.ai/orgs/{org_id}/connectors/{connector_id}/filesystems/copy', 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.timbal.ai/orgs/{org_id}/connectors/{connector_id}/filesystems/copy",
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([
'filesystem_ref' => '<string>',
'kb_id' => 123,
'directory' => '<string>',
'max_files' => 1,
'max_total_bytes' => 1,
'metadata' => [
],
'parse' => true,
'path' => '<string>',
'recursive' => true
]),
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.timbal.ai/orgs/{org_id}/connectors/{connector_id}/filesystems/copy"
payload := strings.NewReader("{\n \"filesystem_ref\": \"<string>\",\n \"kb_id\": 123,\n \"directory\": \"<string>\",\n \"max_files\": 1,\n \"max_total_bytes\": 1,\n \"metadata\": {},\n \"parse\": true,\n \"path\": \"<string>\",\n \"recursive\": true\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.timbal.ai/orgs/{org_id}/connectors/{connector_id}/filesystems/copy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filesystem_ref\": \"<string>\",\n \"kb_id\": 123,\n \"directory\": \"<string>\",\n \"max_files\": 1,\n \"max_total_bytes\": 1,\n \"metadata\": {},\n \"parse\": true,\n \"path\": \"<string>\",\n \"recursive\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.timbal.ai/orgs/{org_id}/connectors/{connector_id}/filesystems/copy")
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 \"filesystem_ref\": \"<string>\",\n \"kb_id\": 123,\n \"directory\": \"<string>\",\n \"max_files\": 1,\n \"max_total_bytes\": 1,\n \"metadata\": {},\n \"parse\": true,\n \"path\": \"<string>\",\n \"recursive\": true\n}"
response = http.request(request)
puts response.read_body{
"job_id": "<string>"
}Copy Filesystem to Knowledge Base
Copy a file or directory tree from a connector filesystem root into a knowledge base’s document store. Store-only by default (parse: true to opt in). Requires fs:copy (0.1.27+).
curl --request POST \
--url https://api.timbal.ai/orgs/{org_id}/connectors/{connector_id}/filesystems/copy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"filesystem_ref": "<string>",
"kb_id": 123,
"directory": "<string>",
"max_files": 1,
"max_total_bytes": 1,
"metadata": {},
"parse": true,
"path": "<string>",
"recursive": true
}
'import requests
url = "https://api.timbal.ai/orgs/{org_id}/connectors/{connector_id}/filesystems/copy"
payload = {
"filesystem_ref": "<string>",
"kb_id": 123,
"directory": "<string>",
"max_files": 1,
"max_total_bytes": 1,
"metadata": {},
"parse": True,
"path": "<string>",
"recursive": True
}
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({
filesystem_ref: '<string>',
kb_id: 123,
directory: '<string>',
max_files: 1,
max_total_bytes: 1,
metadata: {},
parse: true,
path: '<string>',
recursive: true
})
};
fetch('https://api.timbal.ai/orgs/{org_id}/connectors/{connector_id}/filesystems/copy', 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.timbal.ai/orgs/{org_id}/connectors/{connector_id}/filesystems/copy",
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([
'filesystem_ref' => '<string>',
'kb_id' => 123,
'directory' => '<string>',
'max_files' => 1,
'max_total_bytes' => 1,
'metadata' => [
],
'parse' => true,
'path' => '<string>',
'recursive' => true
]),
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.timbal.ai/orgs/{org_id}/connectors/{connector_id}/filesystems/copy"
payload := strings.NewReader("{\n \"filesystem_ref\": \"<string>\",\n \"kb_id\": 123,\n \"directory\": \"<string>\",\n \"max_files\": 1,\n \"max_total_bytes\": 1,\n \"metadata\": {},\n \"parse\": true,\n \"path\": \"<string>\",\n \"recursive\": true\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.timbal.ai/orgs/{org_id}/connectors/{connector_id}/filesystems/copy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"filesystem_ref\": \"<string>\",\n \"kb_id\": 123,\n \"directory\": \"<string>\",\n \"max_files\": 1,\n \"max_total_bytes\": 1,\n \"metadata\": {},\n \"parse\": true,\n \"path\": \"<string>\",\n \"recursive\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.timbal.ai/orgs/{org_id}/connectors/{connector_id}/filesystems/copy")
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 \"filesystem_ref\": \"<string>\",\n \"kb_id\": 123,\n \"directory\": \"<string>\",\n \"max_files\": 1,\n \"max_total_bytes\": 1,\n \"metadata\": {},\n \"parse\": true,\n \"path\": \"<string>\",\n \"recursive\": true\n}"
response = http.request(request)
puts response.read_body{
"job_id": "<string>"
}Authorizations
Timbal API key. Obtain your API key from the Timbal platform settings. See Authentication for more information.
Body
Filesystem root ref on the node (from /browse/filesystems).
Target KB (numeric id, same as the /k2 routes).
KB directory files land under (root when omitted). A recursive copy recreates the tree below it.
Job cap on files shipped. Omit for the node default (5000).
x >= 0Job cap on aggregate raw bytes. Omit for the node default (2 GiB).
x >= 0Metadata stamped onto every landed file.
Parse + embed after storing. Default false — copy is store-only; the
KB's auto-processing setting never applies to connector copies.
Path relative to the root: a file, or a directory when recursive.
Empty / omitted / whitespace = the filesystem root (same as the
connector's CopyFileJob / browse verbs).
true = path is a directory: walk it and stream every regular file
(symlinks skipped). Copying a directory without it is refused node-side.
Response
Copy job accepted and dispatched