Docs
Skip to content
post

Create bucket

Endpoint

posthttps://<REGION>.cloud.appwrite.io/v1/storage/buckets

Description

Required scopes

buckets.write

Authentication

Initialize the Appwrite client with setProject() and a server API key (setKey()). For direct REST calls, send X-Appwrite-Project and X-Appwrite-Key.

Parameters

string
Required
string
Required
array
boolean
boolean
integer
array
enum
boolean
boolean
boolean
Status
Content type
201
application/json

Bucket

Name
Type
Description
string
string
string
arrayof string
boolean
string
boolean
integer
arrayof string
string
boolean
boolean
boolean
integer
Dart
import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart' as enums;
import 'package:dart_appwrite/permission.dart';
import 'package:dart_appwrite/role.dart';
Client client = 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
Storage storage = Storage(client);
Bucket result = await storage.createBucket(
bucketId: '<BUCKET_ID>',
name: '<NAME>',
permissions: [Permission.read(Role.any())], // (optional)
fileSecurity: false, // (optional)
enabled: false, // (optional)
maximumFileSize: 1, // (optional)
allowedFileExtensions: [], // (optional)
compression: enums.Compression.none, // (optional)
encryption: false, // (optional)
antivirus: false, // (optional)
transformations: false, // (optional)
);