curl --request POST \
--url https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/filesystem-copy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destination": "/app/destination",
"source": "/app/source",
"noOverwrite": false
}
'import requests
url = "https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/filesystem-copy"
payload = {
"destination": "/app/destination",
"source": "/app/source",
"noOverwrite": False
}
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({destination: '/app/destination', source: '/app/source', noOverwrite: false})
};
fetch('https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/filesystem-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://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/filesystem-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([
'destination' => '/app/destination',
'source' => '/app/source',
'noOverwrite' => false
]),
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://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/filesystem-copy"
payload := strings.NewReader("{\n \"destination\": \"/app/destination\",\n \"source\": \"/app/source\",\n \"noOverwrite\": false\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://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/filesystem-copy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"destination\": \"/app/destination\",\n \"source\": \"/app/source\",\n \"noOverwrite\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/filesystem-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 \"destination\": \"/app/destination\",\n \"source\": \"/app/source\",\n \"noOverwrite\": false\n}"
response = http.request(request)
puts response.read_body{
"destination": "<string>",
"message": "<string>",
"source": "<string>"
}{
"error": "Error message",
"code": "FILE_ALREADY_EXISTS"
}{
"error": "Error message",
"code": "FILE_ALREADY_EXISTS"
}{
"error": "Error message",
"code": "FILE_ALREADY_EXISTS"
}Copy a file or directory
Recursively copy a file or directory in one request, placed like cp -r: when destination is an existing directory (or a symlink to one), the copy goes inside it, named after source; otherwise destination is the copy’s path. Relative paths use the filesystem working directory. Source symlinks are copied as symlinks; special files are refused. By default existing files are overwritten and existing directories merged.
With noOverwrite=true, every entry is created exclusively (O_EXCL, mkdir, symlink), with no check-then-write race: an existing final target, including an empty directory or a dangling symlink, returns 409 with code FILE_ALREADY_EXISTS and is left unchanged. A copy is not a transaction: on a later failure, entries it already created remain.
curl --request POST \
--url https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/filesystem-copy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"destination": "/app/destination",
"source": "/app/source",
"noOverwrite": false
}
'import requests
url = "https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/filesystem-copy"
payload = {
"destination": "/app/destination",
"source": "/app/source",
"noOverwrite": False
}
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({destination: '/app/destination', source: '/app/source', noOverwrite: false})
};
fetch('https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/filesystem-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://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/filesystem-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([
'destination' => '/app/destination',
'source' => '/app/source',
'noOverwrite' => false
]),
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://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/filesystem-copy"
payload := strings.NewReader("{\n \"destination\": \"/app/destination\",\n \"source\": \"/app/source\",\n \"noOverwrite\": false\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://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/filesystem-copy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"destination\": \"/app/destination\",\n \"source\": \"/app/source\",\n \"noOverwrite\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sbx-{sandbox_id}-{workspace_id}.{region}.bl.run/filesystem-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 \"destination\": \"/app/destination\",\n \"source\": \"/app/source\",\n \"noOverwrite\": false\n}"
response = http.request(request)
puts response.read_body{
"destination": "<string>",
"message": "<string>",
"source": "<string>"
}{
"error": "Error message",
"code": "FILE_ALREADY_EXISTS"
}{
"error": "Error message",
"code": "FILE_ALREADY_EXISTS"
}{
"error": "Error message",
"code": "FILE_ALREADY_EXISTS"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Source, destination, and optional noOverwrite flag
Was this page helpful?