Files
Copy a file
Creates a new file from an existing one, optionally in another bucket or folder. Copying creates a new fileId; it does not create a version of the source.
Required scopes: buckets:write + files:write.
POST
/
files
/
copy
/
{fileId}
Copy a file
curl --request POST \
--url https://api.everabyte.io/api/files/copy/{fileId} \
--header 'Content-Type: application/json' \
--header 'X-Public-Key: <api-key>' \
--header 'X-Secret-Key: <api-key>' \
--data '
{
"destinationFolderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"destinationBucketId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {
'X-Public-Key': '<api-key>',
'X-Secret-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
destinationFolderId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
destinationBucketId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.everabyte.io/api/files/copy/{fileId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {
'X-Public-Key': '<api-key>',
'X-Secret-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
destinationFolderId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
destinationBucketId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.everabyte.io/api/files/copy/{fileId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.everabyte.io/api/files/copy/{fileId}"
payload = {
"destinationFolderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"destinationBucketId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"X-Public-Key": "<api-key>",
"X-Secret-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.everabyte.io/api/files/copy/{fileId}",
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([
'destinationFolderId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'destinationBucketId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Public-Key: <api-key>",
"X-Secret-Key: <api-key>"
],
]);
$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.everabyte.io/api/files/copy/{fileId}"
payload := strings.NewReader("{\n \"destinationFolderId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"destinationBucketId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Public-Key", "<api-key>")
req.Header.Add("X-Secret-Key", "<api-key>")
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))
}{
"status": 200,
"message": "File copied",
"data": {
"originalFileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"newFileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"destinationFolderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"destinationBucketId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"newHashName": "<string>"
}
}{
"status": 123,
"statusCode": 123,
"message": "<string>",
"error": "<string>",
"code": "<string>",
"data": {}
}{
"status": 123,
"statusCode": 123,
"message": "<string>",
"error": "<string>",
"code": "<string>",
"data": {}
}{
"status": 123,
"statusCode": 123,
"message": "<string>",
"error": "<string>",
"code": "<string>",
"data": {}
}{
"status": 123,
"statusCode": 123,
"message": "<string>",
"error": "<string>",
"code": "<string>",
"data": {}
}{
"status": 123,
"statusCode": 123,
"message": "<string>",
"error": "<string>",
"code": "<string>",
"data": {}
}{
"status": 123,
"statusCode": 123,
"message": "<string>",
"error": "<string>",
"code": "<string>",
"data": {}
}{
"status": 123,
"statusCode": 123,
"message": "<string>",
"error": "<string>",
"code": "<string>",
"data": {}
}Authorizations
Public half of the company API key. Format: pk_ followed by 64 hexadecimal characters.
Secret half of the company API key. Format: sk_ followed by 64 hexadecimal characters. Stored as a hash server-side and shown only at creation or rotation.
Path Parameters
File identifier.
Body
application/json
⌘I
Copy a file
curl --request POST \
--url https://api.everabyte.io/api/files/copy/{fileId} \
--header 'Content-Type: application/json' \
--header 'X-Public-Key: <api-key>' \
--header 'X-Secret-Key: <api-key>' \
--data '
{
"destinationFolderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"destinationBucketId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'const options = {
method: 'POST',
headers: {
'X-Public-Key': '<api-key>',
'X-Secret-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
destinationFolderId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
destinationBucketId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.everabyte.io/api/files/copy/{fileId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {
'X-Public-Key': '<api-key>',
'X-Secret-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
destinationFolderId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
destinationBucketId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.everabyte.io/api/files/copy/{fileId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.everabyte.io/api/files/copy/{fileId}"
payload = {
"destinationFolderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"destinationBucketId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"X-Public-Key": "<api-key>",
"X-Secret-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.everabyte.io/api/files/copy/{fileId}",
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([
'destinationFolderId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'destinationBucketId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Public-Key: <api-key>",
"X-Secret-Key: <api-key>"
],
]);
$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.everabyte.io/api/files/copy/{fileId}"
payload := strings.NewReader("{\n \"destinationFolderId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"destinationBucketId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Public-Key", "<api-key>")
req.Header.Add("X-Secret-Key", "<api-key>")
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))
}{
"status": 200,
"message": "File copied",
"data": {
"originalFileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"newFileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"destinationFolderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"destinationBucketId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"newHashName": "<string>"
}
}{
"status": 123,
"statusCode": 123,
"message": "<string>",
"error": "<string>",
"code": "<string>",
"data": {}
}{
"status": 123,
"statusCode": 123,
"message": "<string>",
"error": "<string>",
"code": "<string>",
"data": {}
}{
"status": 123,
"statusCode": 123,
"message": "<string>",
"error": "<string>",
"code": "<string>",
"data": {}
}{
"status": 123,
"statusCode": 123,
"message": "<string>",
"error": "<string>",
"code": "<string>",
"data": {}
}{
"status": 123,
"statusCode": 123,
"message": "<string>",
"error": "<string>",
"code": "<string>",
"data": {}
}{
"status": 123,
"statusCode": 123,
"message": "<string>",
"error": "<string>",
"code": "<string>",
"data": {}
}{
"status": 123,
"statusCode": 123,
"message": "<string>",
"error": "<string>",
"code": "<string>",
"data": {}
}