Create database
Endpoint
posthttps://<REGION>.cloud.appwrite.io/v1/databases
Description
Create a new Database.
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.
Database name. Max length: 128 chars.
Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
Database
Database ID.
Database name.
Database creation date in ISO 8601 format.
Database update date in ISO 8601 format.
If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.
Database type.
Database status. Possible values: provisioning, ready or failed
Database backup policies.
Object type
Database backup archives.
Object type
from appwrite.client import Clientfrom appwrite.services.databases import Databasesfrom appwrite.models import Database
client = Client()client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpointclient.set_project('<YOUR_PROJECT_ID>') # Your project IDclient.set_key('<YOUR_API_KEY>') # Your secret API key
databases = Databases(client)
result: Database = databases.create( database_id = '<DATABASE_ID>', name = '<NAME>', enabled = False # optional)
print(result.model_dump())Databases
databases
transactions
collections
attributes
documents
indexes
Create database
Endpoint
posthttps://<REGION>.cloud.appwrite.io/v1/databases
Description
Create a new Database.
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.
Database name. Max length: 128 chars.
Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
Database
Database ID.
Database name.
Database creation date in ISO 8601 format.
Database update date in ISO 8601 format.
If database is enabled. Can be 'enabled' or 'disabled'. When disabled, the database is inaccessible to users, but remains accessible to Server SDKs using API keys.
Database type.
Database status. Possible values: provisioning, ready or failed
Database backup policies.
Object type
Database backup archives.
Object type
from appwrite.client import Clientfrom appwrite.services.databases import Databasesfrom appwrite.models import Database
client = Client()client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpointclient.set_project('<YOUR_PROJECT_ID>') # Your project IDclient.set_key('<YOUR_API_KEY>') # Your secret API key
databases = Databases(client)
result: Database = databases.create( database_id = '<DATABASE_ID>', name = '<NAME>', enabled = False # optional)
print(result.model_dump())