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?
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 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.
import Appwrite
let client = Client() .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let storage = Storage(client)
let bucket = try await storage.createBucket( bucketId: "[BUCKET_ID]", name: "[NAME]")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 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?
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 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.
import Appwrite
let client = Client() .setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID .setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
let storage = Storage(client)
let bucket = try await storage.createBucket( bucketId: "[BUCKET_ID]", name: "[NAME]")