The Sites service allows you to host, deploy and manage web applications directly within the Appwrite platform. You can use this service to create and manage sites, handle deployments, configure domains, and set up environment variables.
Sites supports both static and server-side rendered (SSR) websites. Static sites are pre-built and served as-is, while SSR sites generate content dynamically for each request. The service automatically handles SSL certificates, provides unique domains for each site, and allows custom domain configuration.
Each deployed site benefits from a global CDN with strategic edge locations as well as advanced security features offered by Appwrite Network. Site deployments can be configured with custom environment variables, build settings, and timeouts. You can deploy sites manually or set up automatic deployments from Git repositories for continuous integration and delivery.
You can find more information on how to build and deploy a web app in the Sites product pages.
https://<REGION>.cloud.appwrite.io/v1
Create document
Create a new Document. Before using this route, you should create a new collection resource using either a server integration API or directly from your database console.
Request
databaseId string requiredDatabase ID.
collectionId string requiredCollection ID. You can create a new collection using the Database service server integration. Make sure to define attributes before creating documents.
documentId string Document 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.data object Document data as JSON object.
permissions array An array of permissions strings. By default, only the current user is granted all permissions. Learn more about permissions.
Response
201 application/json
Rate limits
This endpoint is rate limited. You can only make a limited number of request to his endpoint within a specific time frame.
The limit is applied for each unique limit key.
Time frameAttemptsKey1 minutes 120 requests IP + METHOD + URL + USER ID
POST /databases/{databaseId}/collections/{collectionId}/documents
import { Client, Databases } from "appwrite";
const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>'); // Your project ID
const databases = new Databases(client);
const result = await databases.createDocument(
'<DATABASE_ID>', // databaseId
'<COLLECTION_ID>', // collectionId
'<DOCUMENT_ID>', // documentId
{}, // data
["read("any")"] // permissions (optional)
);
console.log(result);