Actions181
- Account Actions
- Get Account
- Create Account
- Update Email
- Update Name
- Update Password
- Update Phone
- Update Status
- Get Preferences
- Update Preferences
- List Sessions
- Delete Sessions
- Get Session
- Update Session
- Delete Session
- Create Anonymous Session
- Create Email/Password Session
- Create Magic URL Session
- Create OAuth2 Session
- Create Phone Session
- Create Session from Token
- Create JWT
- Create Magic URL
- Create Phone Token
- Create Email Verification
- Update Email Verification
- Create Phone Verification
- Update Phone Verification
- Create Password Recovery
- Update Password Recovery
- Create Recovery
- Update Recovery
- Update MFA
- Create MFA Authenticator
- Update MFA Authenticator
- Delete MFA Authenticator
- Create MFA Challenge
- Update MFA Challenge
- Attribute Actions
- Avatars Actions
- Collection Actions
- Database Actions
- Document Actions
- Functions Actions
- Index Actions
- Locale Actions
- Messaging Actions
- Sites Actions
- Storage Actions
- Teams Actions
- Users Actions
Document → Create
AI-generatedOverview
This node interacts with the Appwrite API to create a new document within a specified database and collection. It is useful for automating the creation of documents in Appwrite databases, such as adding new records or entries programmatically. For example, it can be used to add user data, product information, or any structured data as JSON into an Appwrite collection.
Use Case Examples
- Creating a new user profile document in a user database.
- Adding a new product entry to an inventory collection.
Properties
| Name | Meaning |
|---|---|
| Database ID | The ID of the database where the document will be created. |
| Collection ID | The ID of the collection within the database where the document will be created. |
| Document ID | The ID of the document to create. Can be set to unique() to generate a unique ID automatically. |
| Data | The JSON data representing the content of the document to be created. |
| Permissions | An array of permission strings defining access control for the document. |
Output
JSON
$id- The unique identifier of the created document.$collectionId- The ID of the collection containing the document.$databaseId- The ID of the database containing the collection.$createdAt- Timestamp when the document was created.$updatedAt- Timestamp when the document was last updated.data- The JSON data stored in the document.permissions- The permissions assigned to the document.
Dependencies
- Appwrite API key credential for authentication
Troubleshooting
- Ensure the databaseId and collectionId are correct and exist in your Appwrite project.
- Verify that the API key credential has sufficient permissions to create documents.
- Check the JSON format of the data property to avoid syntax errors.
- If using unique() for documentId, ensure the function is supported and correctly generates unique IDs.
Links
- Appwrite Documentation - Create Document - Official documentation on creating documents in Appwrite databases.