Data Types

PutFolder

Creates or updates the folder specified by the folderPath.

If the folder's ancestors do not exist, they will be created automatically (with empty FolderSettings).

Note: you don't need to create folders before uploading files to them.

Requires a secret_* API key. Alternatively, you can use a public_* API key and JWT-based auth.

PUT /v2/accounts/{accountId}/folders
cURL
1curl "https://api.bytescale.com/v2/accounts/{accountId}/folders" \
2 -X PUT \
3 -H "Authorization: Bearer YOUR_API_KEY" \
4 -H "Content-Type: application/json" \
5 -d @- << EOF
6 {
7 "allowUnnamedFolder": false,
8 "folderPath": "/uploads",
9 "folderSettings": {
10 "description": {
11 "set": true,
12 "value": "This is an example folder description."
13 },
14 "publicPermissions": {
15 "set": true,
16 "value": [
17 {
18 "permissions": {
19 "file": {
20 "downloadFile": [
21 "*"
22 ]
23 }
24 },
25 "scope": "Children"
26 }
27 ]
28 },
29 "storageLayer": {
30 "set": true,
31 "value": {
32 "bucket": {
33 "bucketName": "my-bucket",
34 "bucketRegion": "nyc3",
35 "objectKeyPrefix": "an/example/key"
36 },
37 "credentials": {
38 "spacesAccessKey": "AKIAIOSFODNN7EXAMPLE",
39 "spacesSecretKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
40 },
41 "type": "DigitalOceanSpace",
42 "useAbsolutePaths": true
43 }
44 }
45 }
46 }
47EOF
Response (200)
1{
2 "folderPath": "/uploads",
3 "settings": {
4 "description": "This is an example folder description.",
5 "publicPermissions": [
6 {
7 "permissions": {
8 "file": {
9 "downloadFile": [
10 "*"
11 ]
12 }
13 },
14 "scope": "Children"
15 }
16 ],
17 "storageLayer": {
18 "type": "InternalStorageV2"
19 }
20 },
21 "settingsInherited": {
22 "publicPermissions": {
23 "folderPath": "/uploads",
24 "value": [
25 {
26 "permissions": {
27 "file": {
28 "downloadFile": [
29 "*"
30 ]
31 }
32 },
33 "scope": "Children"
34 }
35 ]
36 },
37 "storageLayer": {
38 "folderPath": "/uploads",
39 "value": {
40 "bucket": {
41 "bucketName": "my-bucket",
42 "bucketRegion": "nyc3",
43 "objectKeyPrefix": "an/example/key"
44 },
45 "type": "DigitalOceanSpace",
46 "useAbsolutePaths": true
47 }
48 }
49 },
50 "type": "Folder",
51 "virtual": true
52}

Your account ID.

This is visible on the settings page:

https://www.bytescale.com/dashboard/settings

Example: "A623uY2"

Type: String

Length: 7

Add one of these Authorization header values to your request:

Option 1: prefix "Bearer " to your API key. The result is your Authorization header value.

Option 2: use HTTP basic authorization with apikey as your username and your API key as your password.

For advanced options, please see:

https://www.bytescale.com/docs/auth

Note: this endpoint requires a secret_* API key.

Type: String

This endpoints requires a JSON request body.

Type: String

Value: "application/json"

Was this section helpful? Yes No

You are using an outdated browser.

This website requires a modern web browser -- the latest versions of these browsers are supported: