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 your own unique ID or pass the string unique() to auto generate it. 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
Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the read and write params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. learn more about permissions and get a full list of available permissions.
An array of strings with read permissions. By default no user is granted with any read permissions. learn more about permissions and get a full list of available permissions.
An array of strings with write permissions. By default no user is granted with any write permissions. learn more about permissions and get a full list of available permissions.
Is bucket enabled?
Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the _APP_STORAGE_LIMIT environment variable. Learn more about storage environment variables
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
Bucket
Bucket ID.
Bucket creation date in Unix timestamp.
Bucket update date in Unix timestamp.
File read permissions.
File write permissions.
Bucket permission model. Possible values: bucket or file
Bucket name.
Bucket enabled.
Maximum file size supported.
Allowed file extensions.
Bucket is encrypted.
Virus scanning is enabled.
from appwrite.client import Clientfrom appwrite.services.storage import Storage
client = Client()
(client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key)
storage = Storage(client)
result = storage.create_bucket('[BUCKET_ID]', '[NAME]', 'file')Storage
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 your own unique ID or pass the string unique() to auto generate it. 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
Permissions type model to use for reading files in this bucket. You can use bucket-level permission set once on the bucket using the read and write params, or you can set file-level permission where each file read and write params will decide who has access to read and write to each file individually. learn more about permissions and get a full list of available permissions.
An array of strings with read permissions. By default no user is granted with any read permissions. learn more about permissions and get a full list of available permissions.
An array of strings with write permissions. By default no user is granted with any write permissions. learn more about permissions and get a full list of available permissions.
Is bucket enabled?
Maximum file size allowed in bytes. Maximum allowed value is 30MB. For self-hosted setups you can change the max limit by changing the _APP_STORAGE_LIMIT environment variable. Learn more about storage environment variables
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
Bucket
Bucket ID.
Bucket creation date in Unix timestamp.
Bucket update date in Unix timestamp.
File read permissions.
File write permissions.
Bucket permission model. Possible values: bucket or file
Bucket name.
Bucket enabled.
Maximum file size supported.
Allowed file extensions.
Bucket is encrypted.
Virus scanning is enabled.
from appwrite.client import Clientfrom appwrite.services.storage import Storage
client = Client()
(client .set_endpoint('https://[HOSTNAME_OR_IP]/v1') # Your API Endpoint .set_project('5df5acd0d48c2') # Your project ID .set_key('919c2d18fb5d4...a2ae413da83346ad2') # Your secret API key)
storage = Storage(client)
result = storage.create_bucket('[BUCKET_ID]', '[NAME]', 'file')