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.
Dedicated database lifecycle status. Null when the database has no valid dedicated backing.
Underlying engine of the dedicated backing: postgresql, mysql, or mongodb. A managed product (tablesdb, documentsdb, vectorsdb) reports the engine it runs on, so its type and engine can differ. Null when the database has no dedicated backing.
Compute specification identifier of the dedicated backing, e.g. s-2vcpu-2gb. Null when the database has no dedicated backing.
Number of secondary high availability replicas, excluding the primary. Null when backing configuration is unavailable.
Error message when the dedicated backing failed. Null when the database has no dedicated backing or has not failed.
Container status of the dedicated backing: active or inactive. Null when the database has no dedicated backing or the runtime has not reported one.
Idle-lifecycle state of the dedicated backing: active, warm, cold, or hibernated. Null when the database has no dedicated backing or the runtime has not reported one.
Database backup policies.
Object type
Database backup archives.
Object type
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 databases = new sdk.Databases(client);
const result = await databases.create({ databaseId: '<DATABASE_ID>', name: '<NAME>', enabled: false, // optional});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.
Dedicated database lifecycle status. Null when the database has no valid dedicated backing.
Underlying engine of the dedicated backing: postgresql, mysql, or mongodb. A managed product (tablesdb, documentsdb, vectorsdb) reports the engine it runs on, so its type and engine can differ. Null when the database has no dedicated backing.
Compute specification identifier of the dedicated backing, e.g. s-2vcpu-2gb. Null when the database has no dedicated backing.
Number of secondary high availability replicas, excluding the primary. Null when backing configuration is unavailable.
Error message when the dedicated backing failed. Null when the database has no dedicated backing or has not failed.
Container status of the dedicated backing: active or inactive. Null when the database has no dedicated backing or the runtime has not reported one.
Idle-lifecycle state of the dedicated backing: active, warm, cold, or hibernated. Null when the database has no dedicated backing or the runtime has not reported one.
Database backup policies.
Object type
Database backup archives.
Object type
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 databases = new sdk.Databases(client);
const result = await databases.create({ databaseId: '<DATABASE_ID>', name: '<NAME>', enabled: false, // optional});