NAppwrite icon

NAppwrite

Use Appwrite's API from inside N8N, updated by @ZachHandley

Overview

The "Update User" operation in this node allows you to modify an existing user's details within the Appwrite backend service. This includes updating their email, name, phone number, password, preferences, labels, and status, as well as toggling verification flags for email and phone. It is useful in scenarios where user information needs to be kept current or adjusted based on changes such as profile updates, security enhancements (e.g., password change), or administrative actions (e.g., enabling/disabling a user).

Practical examples:

  • Updating a user's contact information after they submit a profile update form.
  • Changing a user's password upon request or security policy enforcement.
  • Enabling or disabling a user account without deleting it ("fake delete").
  • Adjusting user preferences or labels for segmentation or personalization.

Properties

Name Meaning
User ID The unique identifier of the user to update.
Email The user's email address to set or update.
Verify Email? Boolean flag indicating whether to verify the user's email address.
Name The user's full name to set or update.
Phone The user's phone number to set or update.
Verify Phone? Boolean flag indicating whether to verify the user's phone number.
Password The current password of the user (required for authentication or validation).
New Password A new password to update the user's password with.
Preferences JSON object representing user preferences to create or update.
Labels JSON array of strings representing labels/tags associated with the user.
Status Boolean indicating whether the user is enabled (true) or disabled/fake deleted (false).

Output

The output is a JSON array containing the updated user object returned from the Appwrite API. This object typically includes all user properties such as user ID, email, name, phone, verification statuses, preferences, labels, and status flags reflecting the latest state after the update.

No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to an Appwrite backend instance.
  • Needs credentials including the Appwrite API URL, project ID, and an API key credential with permissions to update users.
  • The node uses the official Appwrite SDK (node-appwrite) internally to perform the update operation.

Troubleshooting

  • Common issues:

    • Invalid or missing User ID will cause the update to fail.
    • Incorrect or insufficient API credentials can lead to authorization errors.
    • Providing invalid JSON for preferences or labels may cause parsing errors.
    • Attempting to update with an incorrect current password might be rejected by the backend.
  • Error messages:

    • Errors from the Appwrite API will be propagated, often indicating issues like "User not found", "Unauthorized", or "Invalid input".
    • If the node is configured to continue on failure, errors will be included in the output JSON under an error field.
  • Resolutions:

    • Ensure the User ID exists and is correct.
    • Verify API credentials and permissions.
    • Validate JSON inputs before passing them to the node.
    • Confirm that the current password is correct if required by the backend.

Links and References

Discussion