Create bucket
Endpoint
posthttps://<REGION>.cloud.appwrite.io/v1/storage/buckets
Description
Create a new storage bucket.
Required scopes
Authentication
setProject() and a server API key (setKey()). For direct REST calls, send X-Appwrite-Project and X-Appwrite-Key.Parameters
Unique Id. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
Bucket name
An array of permission strings. By default, no user is granted with any permissions. Learn more about permissions.
Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. Learn more about permissions.
Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
Maximum file size allowed in bytes. Maximum allowed value is 5GB.
Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
Are image transformations enabled?
Bucket
Bucket ID.
Bucket creation time in ISO 8601 format.
Bucket update date in ISO 8601 format.
Bucket permissions. Learn more about permissions.
Whether file-level security is enabled. Learn more about permissions.
Bucket name.
Bucket enabled.
Maximum file size supported.
Allowed file extensions.
Bucket is encrypted.
Virus scanning is enabled.
Image transformations are enabled.
Total size of this bucket in bytes.
const sdk = require('node-appwrite');
const client = new sdk.Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setKey('<YOUR_API_KEY>'); // Your secret API key
const storage = new sdk.Storage(client);
const result = await storage.createBucket({ bucketId: '<BUCKET_ID>', name: '<NAME>', permissions: [sdk.Permission.read(sdk.Role.any())], // optional fileSecurity: false, // optional enabled: false, // optional maximumFileSize: 1, // optional allowedFileExtensions: [], // optional compression: sdk.Compression.None, // optional encryption: false, // optional antivirus: false, // optional transformations: false // optional});Storage
buckets
files
Create bucket
Endpoint
posthttps://<REGION>.cloud.appwrite.io/v1/storage/buckets
Description
Create a new storage bucket.
Required scopes
Authentication
setProject() and a server API key (setKey()). For direct REST calls, send X-Appwrite-Project and X-Appwrite-Key.Parameters
Unique Id. Choose a custom ID or generate a random ID with ID.unique(). Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
Bucket name
An array of permission strings. By default, no user is granted with any permissions. Learn more about permissions.
Enables configuring permissions for individual file. A user needs one of file or bucket level permissions to access a file. Learn more about permissions.
Is bucket enabled? When set to 'disabled', users cannot access the files in this bucket but Server SDKs with and API key can still access the bucket. No files are lost when this is toggled.
Maximum file size allowed in bytes. Maximum allowed value is 5GB.
Allowed file extensions. Maximum of 100 extensions are allowed, each 64 characters long.
Is encryption enabled? For file size above 20MB encryption is skipped even if it's enabled
Is virus scanning enabled? For file size above 20MB AntiVirus scanning is skipped even if it's enabled
Are image transformations enabled?
Bucket
Bucket ID.
Bucket creation time in ISO 8601 format.
Bucket update date in ISO 8601 format.
Bucket permissions. Learn more about permissions.
Whether file-level security is enabled. Learn more about permissions.
Bucket name.
Bucket enabled.
Maximum file size supported.
Allowed file extensions.
Bucket is encrypted.
Virus scanning is enabled.
Image transformations are enabled.
Total size of this bucket in bytes.
const sdk = require('node-appwrite');
const client = new sdk.Client() .setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setKey('<YOUR_API_KEY>'); // Your secret API key
const storage = new sdk.Storage(client);
const result = await storage.createBucket({ bucketId: '<BUCKET_ID>', name: '<NAME>', permissions: [sdk.Permission.read(sdk.Role.any())], // optional fileSecurity: false, // optional enabled: false, // optional maximumFileSize: 1, // optional allowedFileExtensions: [], // optional compression: sdk.Compression.None, // optional encryption: false, // optional antivirus: false, // optional transformations: false // optional});