Docs
Skip to content
post

Create site

Endpoint

posthttps://<REGION>.cloud.appwrite.io/v1/sites

Description

Required scopes

sites.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
enum
Required
boolean
boolean
integer
string
string
string
string
enum
Required
enum
string
string
string
string
boolean
string
array
array
string
string
integer
Status
Content type
201
application/json

Site

Name
Type
Description
string
string
string
string
boolean
boolean
boolean
string
integer
string
string
string
string
string
string
string
arrayof Variable

Object type

integer
string
string
string
string
string
string
string
string
boolean
arrayof string
arrayof string
string
string
string
string
string
JavaScript
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
});