Docs
Skip to content
post

Create document

Endpoint

posthttps://<REGION>.cloud.appwrite.io...ollections/{collectionId}/documents

Description

Required scopes

documents.write

Authentication

Initialize the Appwrite client with setProject() and ensure the user is signed in. The SDK sends the session header automatically after login.

Rate limit

Up to 120 requests per minute for each IP address calling this endpoint.
Server API key requests bypass this rate limit.

Path

string
Required
string
Required

Body

string
Required
object
Required
array
Status
Content type
201
application/json

Document

Name
Type
Description
string
string
string
string
string
arrayof string
JavaScript
import { Client, Databases } from "appwrite";
const client = new Client()
.setEndpoint('https://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);