databases_create_document
Add new documents to Appwrite database collections by specifying database ID, collection ID, document ID, and JSON data. Define collection attributes first before creating documents.
Instructions
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.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database_id | Yes | Database ID. | |
| collection_id | Yes | Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents. | |
| document_id | Yes | 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 | Yes | Document data as JSON object. | |
| permissions | No | An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions). |