curl --request POST \
--url https://{host}/api/volumes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"visibility": "private",
"description": "",
"allow_download": false,
"allow_use": true,
"usable_by": [],
"allow_preview": false,
"connection": "",
"source_path": ""
}
'import requests
url = "https://{host}/api/volumes"
payload = {
"name": "<string>",
"visibility": "private",
"description": "",
"allow_download": False,
"allow_use": True,
"usable_by": [],
"allow_preview": False,
"connection": "",
"source_path": ""
}
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({
name: '<string>',
visibility: 'private',
description: '',
allow_download: false,
allow_use: true,
usable_by: [],
allow_preview: false,
connection: '',
source_path: ''
})
};
fetch('https://{host}/api/volumes', 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://{host}/api/volumes",
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([
'name' => '<string>',
'visibility' => 'private',
'description' => '',
'allow_download' => false,
'allow_use' => true,
'usable_by' => [
],
'allow_preview' => false,
'connection' => '',
'source_path' => ''
]),
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://{host}/api/volumes"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"visibility\": \"private\",\n \"description\": \"\",\n \"allow_download\": false,\n \"allow_use\": true,\n \"usable_by\": [],\n \"allow_preview\": false,\n \"connection\": \"\",\n \"source_path\": \"\"\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://{host}/api/volumes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"visibility\": \"private\",\n \"description\": \"\",\n \"allow_download\": false,\n \"allow_use\": true,\n \"usable_by\": [],\n \"allow_preview\": false,\n \"connection\": \"\",\n \"source_path\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/volumes")
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 \"name\": \"<string>\",\n \"visibility\": \"private\",\n \"description\": \"\",\n \"allow_download\": false,\n \"allow_use\": true,\n \"usable_by\": [],\n \"allow_preview\": false,\n \"connection\": \"\",\n \"source_path\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"owner": "<string>",
"name": "<string>",
"visibility": "private",
"description": "<string>",
"created_at": 123,
"allow_download": true,
"allow_use": true,
"usable_by": [
"<string>"
],
"allow_preview": true,
"watermark": true,
"watermark_text": "<string>",
"classification": "<string>",
"backing": "<string>",
"connection": "<string>",
"source_path": "<string>",
"external": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Volume Create
Create a volume: empty and owned by the platform, or a registration of content that already exists on storage the deployment operates.
Registering external content is an administrator’s act, and that is a
narrower rule than it may look. A storage connection’s credential normally
reads the whole bucket, and allowed_prefixes is what keeps a registration
from reaching past what was meant — but deciding what the platform exposes
at all is an administrative decision, not one that belongs to whoever
happens to be able to create a volume in their own namespace.
The connection’s usable_by is not checked here, because it names projects
and a volume belongs to a person. It governs which projects may reference
the resulting volume, and it is checked where a project exists: admission.
curl --request POST \
--url https://{host}/api/volumes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"visibility": "private",
"description": "",
"allow_download": false,
"allow_use": true,
"usable_by": [],
"allow_preview": false,
"connection": "",
"source_path": ""
}
'import requests
url = "https://{host}/api/volumes"
payload = {
"name": "<string>",
"visibility": "private",
"description": "",
"allow_download": False,
"allow_use": True,
"usable_by": [],
"allow_preview": False,
"connection": "",
"source_path": ""
}
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({
name: '<string>',
visibility: 'private',
description: '',
allow_download: false,
allow_use: true,
usable_by: [],
allow_preview: false,
connection: '',
source_path: ''
})
};
fetch('https://{host}/api/volumes', 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://{host}/api/volumes",
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([
'name' => '<string>',
'visibility' => 'private',
'description' => '',
'allow_download' => false,
'allow_use' => true,
'usable_by' => [
],
'allow_preview' => false,
'connection' => '',
'source_path' => ''
]),
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://{host}/api/volumes"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"visibility\": \"private\",\n \"description\": \"\",\n \"allow_download\": false,\n \"allow_use\": true,\n \"usable_by\": [],\n \"allow_preview\": false,\n \"connection\": \"\",\n \"source_path\": \"\"\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://{host}/api/volumes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"visibility\": \"private\",\n \"description\": \"\",\n \"allow_download\": false,\n \"allow_use\": true,\n \"usable_by\": [],\n \"allow_preview\": false,\n \"connection\": \"\",\n \"source_path\": \"\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/volumes")
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 \"name\": \"<string>\",\n \"visibility\": \"private\",\n \"description\": \"\",\n \"allow_download\": false,\n \"allow_use\": true,\n \"usable_by\": [],\n \"allow_preview\": false,\n \"connection\": \"\",\n \"source_path\": \"\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"owner": "<string>",
"name": "<string>",
"visibility": "private",
"description": "<string>",
"created_at": 123,
"allow_download": true,
"allow_use": true,
"usable_by": [
"<string>"
],
"allow_preview": true,
"watermark": true,
"watermark_text": "<string>",
"classification": "<string>",
"backing": "<string>",
"connection": "<string>",
"source_path": "<string>",
"external": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Response
Successful Response
A volume's own record: who may see it, and how its content may be read back.
private, public, team