Files
Upload files into a folder
Uploads one or more files into an existing folder inside a bucket. The folder must belong to the target bucket.
Same limits and multi-file semantics as the bucket-root upload: HTTP 200 on success, and only the first processed file is described in the response.
Requires the scopes buckets:write + files:write.
POST
/
files
/
upload
/
{bucketId}
/
{folderId}
Upload files into a folder
curl --request POST \
--url https://api.everabyte.io/api/files/upload/{bucketId}/{folderId} \
--header 'Content-Type: multipart/form-data' \
--header 'X-Public-Key: <api-key>' \
--header 'X-Secret-Key: <api-key>' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'X-Public-Key': '<api-key>', 'X-Secret-Key': '<api-key>'}
};
options.body = form;
fetch('https://api.everabyte.io/api/files/upload/{bucketId}/{folderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'X-Public-Key': '<api-key>', 'X-Secret-Key': '<api-key>'}
};
options.body = form;
fetch('https://api.everabyte.io/api/files/upload/{bucketId}/{folderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.everabyte.io/api/files/upload/{bucketId}/{folderId}"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {
"X-Public-Key": "<api-key>",
"X-Secret-Key": "<api-key>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.everabyte.io/api/files/upload/{bucketId}/{folderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"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/upload/{bucketId}/{folderId}"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Public-Key", "<api-key>")
req.Header.Add("X-Secret-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": 200,
"message": "File uploaded",
"data": {
"file": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"extFile": "<string>"
},
"fileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"effectiveFolderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fileSize": 123,
"sizeBytes": 123,
"versionId": "<string>",
"scheme": "hybrid-v1",
"encryption": "SSE",
"isUpdate": true,
"warning": {
"is_low": true,
"threshold_bytes": 123,
"remaining_bytes": 123,
"message": "<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": {}
}{
"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
Bucket identifier. Read it from the bucket list, or copy it from the Everabyte dashboard.
Folder identifier.
Body
multipart/form-data
File content. Additional file parts may be sent, up to 10 parts.
⌘I
Upload files into a folder
curl --request POST \
--url https://api.everabyte.io/api/files/upload/{bucketId}/{folderId} \
--header 'Content-Type: multipart/form-data' \
--header 'X-Public-Key: <api-key>' \
--header 'X-Secret-Key: <api-key>' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'X-Public-Key': '<api-key>', 'X-Secret-Key': '<api-key>'}
};
options.body = form;
fetch('https://api.everabyte.io/api/files/upload/{bucketId}/{folderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'X-Public-Key': '<api-key>', 'X-Secret-Key': '<api-key>'}
};
options.body = form;
fetch('https://api.everabyte.io/api/files/upload/{bucketId}/{folderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.everabyte.io/api/files/upload/{bucketId}/{folderId}"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {
"X-Public-Key": "<api-key>",
"X-Secret-Key": "<api-key>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.everabyte.io/api/files/upload/{bucketId}/{folderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Content-Type: multipart/form-data",
"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/upload/{bucketId}/{folderId}"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n<string>\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Public-Key", "<api-key>")
req.Header.Add("X-Secret-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"status": 200,
"message": "File uploaded",
"data": {
"file": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"extFile": "<string>"
},
"fileId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"effectiveFolderId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"fileSize": 123,
"sizeBytes": 123,
"versionId": "<string>",
"scheme": "hybrid-v1",
"encryption": "SSE",
"isUpdate": true,
"warning": {
"is_low": true,
"threshold_bytes": 123,
"remaining_bytes": 123,
"message": "<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": {}
}{
"status": 123,
"statusCode": 123,
"message": "<string>",
"error": "<string>",
"code": "<string>",
"data": {}
}