Create site
Endpoint
posthttps://<REGION>.cloud.appwrite.io/v1/sites
Description
Create a new site.
Required scopes
Authentication
setProject() and a server API key (setKey()). For direct REST calls, send X-Appwrite-Project and X-Appwrite-Key.Parameters
Site 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.
Site name. Max length: 128 chars.
Sites framework.
Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
Maximum request time in seconds.
Install Command.
Build Command.
Custom start command. Leave empty to use default.
Output Directory for site.
Runtime to use during build step.
Framework adapter defining rendering strategy. Allowed values are: static, ssr
Appwrite Installation ID for VCS (Version Control System) deployment.
Fallback file for single page application sites.
Repository ID of the repo linked to the site.
Production branch for the repo linked to the site.
Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
Path to site code in the linked repo.
List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.
List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.
Build specification for the site deployments.
Runtime specification for the SSR executions.
Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
Site
Site ID.
Site creation date in ISO 8601 format.
Site update date in ISO 8601 format.
Site name.
Site enabled.
Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration.
When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
Site framework.
How many days to keep the non-active deployments before they will be automatically deleted.
Site's active deployment ID.
Active deployment creation date in ISO 8601 format.
Screenshot of active deployment with light theme preference file ID.
Screenshot of active deployment with dark theme preference file ID.
Site's latest deployment ID.
Latest deployment creation date in ISO 8601 format.
Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed".
Site variables.
Object type
Site request timeout in seconds.
The install command used to install the site dependencies.
The build command used to build the site.
Custom command to use when starting site runtime.
The directory where the site build output is located.
Site VCS (Version Control System) installation id.
VCS (Version Control System) Repository ID
VCS (Version Control System) branch name
Path to site in VCS (Version Control System) repository
Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests
List of branch name patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all branches.
List of file path patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all file changes.
Machine specification for deployment builds.
Machine specification for SSR executions.
Site build runtime.
Site framework adapter.
Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.
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 sites = new sdk.Sites(client);
const result = await sites.create({ siteId: '<SITE_ID>', name: '<NAME>', framework: sdk.Framework.Analog, buildRuntime: sdk.BuildRuntime.Node145, enabled: false, // optional logging: false, // optional timeout: 1, // optional installCommand: '<INSTALL_COMMAND>', // optional buildCommand: '<BUILD_COMMAND>', // optional startCommand: '<START_COMMAND>', // optional outputDirectory: '<OUTPUT_DIRECTORY>', // optional adapter: sdk.Adapter.Static, // optional installationId: '<INSTALLATION_ID>', // optional fallbackFile: '<FALLBACK_FILE>', // optional providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional providerBranch: '<PROVIDER_BRANCH>', // optional providerSilentMode: false, // optional providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional providerBranches: [], // optional providerPaths: [], // optional buildSpecification: '', // optional runtimeSpecification: '', // optional deploymentRetention: 0 // optional});Sites
sites
frameworks
deployments
logs
variables
Create site
Endpoint
posthttps://<REGION>.cloud.appwrite.io/v1/sites
Description
Create a new site.
Required scopes
Authentication
setProject() and a server API key (setKey()). For direct REST calls, send X-Appwrite-Project and X-Appwrite-Key.Parameters
Site 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.
Site name. Max length: 128 chars.
Sites framework.
Is site enabled? When set to 'disabled', users cannot access the site but Server SDKs with and API key can still access the site. No data is lost when this is toggled.
When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
Maximum request time in seconds.
Install Command.
Build Command.
Custom start command. Leave empty to use default.
Output Directory for site.
Runtime to use during build step.
Framework adapter defining rendering strategy. Allowed values are: static, ssr
Appwrite Installation ID for VCS (Version Control System) deployment.
Fallback file for single page application sites.
Repository ID of the repo linked to the site.
Production branch for the repo linked to the site.
Is the VCS (Version Control System) connection in silent mode for the repo linked to the site? In silent mode, comments will not be made on commits and pull requests.
Path to site code in the linked repo.
List of branch name patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all branches.
List of file path patterns to trigger automatic deployments. Supports wildcards. Leave empty to deploy on all file changes.
Build specification for the site deployments.
Runtime specification for the SSR executions.
Days to keep non-active deployments before deletion. Value 0 means all deployments will be kept.
Site
Site ID.
Site creation date in ISO 8601 format.
Site update date in ISO 8601 format.
Site name.
Site enabled.
Is the site deployed with the latest configuration? This is set to false if you've changed an environment variables, entrypoint, commands, or other settings that needs redeploy to be applied. When the value is false, redeploy the site to update it with the latest configuration.
When disabled, request logs will exclude logs and errors, and site responses will be slightly faster.
Site framework.
How many days to keep the non-active deployments before they will be automatically deleted.
Site's active deployment ID.
Active deployment creation date in ISO 8601 format.
Screenshot of active deployment with light theme preference file ID.
Screenshot of active deployment with dark theme preference file ID.
Site's latest deployment ID.
Latest deployment creation date in ISO 8601 format.
Status of latest deployment. Possible values are "waiting", "processing", "building", "ready", and "failed".
Site variables.
Object type
Site request timeout in seconds.
The install command used to install the site dependencies.
The build command used to build the site.
Custom command to use when starting site runtime.
The directory where the site build output is located.
Site VCS (Version Control System) installation id.
VCS (Version Control System) Repository ID
VCS (Version Control System) branch name
Path to site in VCS (Version Control System) repository
Is VCS (Version Control System) connection is in silent mode? When in silence mode, no comments will be posted on the repository pull or merge requests
List of branch name patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all branches.
List of file path patterns that trigger automatic deployments. Supports glob wildcards. Empty list deploys on all file changes.
Machine specification for deployment builds.
Machine specification for SSR executions.
Site build runtime.
Site framework adapter.
Name of fallback file to use instead of 404 page. If null, Appwrite 404 page will be displayed.
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 sites = new sdk.Sites(client);
const result = await sites.create({ siteId: '<SITE_ID>', name: '<NAME>', framework: sdk.Framework.Analog, buildRuntime: sdk.BuildRuntime.Node145, enabled: false, // optional logging: false, // optional timeout: 1, // optional installCommand: '<INSTALL_COMMAND>', // optional buildCommand: '<BUILD_COMMAND>', // optional startCommand: '<START_COMMAND>', // optional outputDirectory: '<OUTPUT_DIRECTORY>', // optional adapter: sdk.Adapter.Static, // optional installationId: '<INSTALLATION_ID>', // optional fallbackFile: '<FALLBACK_FILE>', // optional providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // optional providerBranch: '<PROVIDER_BRANCH>', // optional providerSilentMode: false, // optional providerRootDirectory: '<PROVIDER_ROOT_DIRECTORY>', // optional providerBranches: [], // optional providerPaths: [], // optional buildSpecification: '', // optional runtimeSpecification: '', // optional deploymentRetention: 0 // optional});