ZAppwrite icon

ZAppwrite

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

Overview

This node integrates with the Appwrite API to manage user sessions among other resources. Specifically, the "Delete User Sessions" operation under the "Users" resource allows you to delete all active sessions for a specified user by their User ID. This is useful in scenarios such as:

  • Forcing logout of a user from all devices after a security incident.
  • Revoking access when a user's permissions change or account is disabled.
  • Managing session lifecycle programmatically within automated workflows.

Example: You can automate the process of deleting all sessions for a user immediately after they reset their password to ensure no old sessions remain active.

Properties

Name Meaning
User ID The unique identifier of the user whose sessions you want to delete.

Output

The output JSON contains a single field success which indicates whether the deletion of all user sessions was successful. It is an object with a boolean property, e.g.:

{
  "success": true
}

This confirms that all sessions for the specified user have been deleted.

Dependencies

  • Requires an Appwrite API endpoint URL, project ID, and an API key credential configured in n8n to authenticate requests.
  • Uses the official Appwrite SDK (node-appwrite) internally to perform API calls.
  • The node depends on the external Appwrite service being accessible and properly configured.

Troubleshooting

  • Common issues:

    • Invalid or missing User ID parameter will cause the operation to fail.
    • Authentication errors if the API key or project credentials are incorrect or expired.
    • Network connectivity issues to the Appwrite server.
    • Insufficient permissions for the API key to delete user sessions.
  • Error messages:

    • Errors thrown by the Appwrite SDK will be surfaced, typically indicating HTTP status codes and messages like "Unauthorized", "User not found", or "Forbidden".
    • To resolve, verify the User ID exists, check API credentials, and ensure the API key has appropriate permissions.

Links and References

Discussion