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, specifically allowing deletion of a particular session for a given user. It is useful in scenarios where you want to programmatically revoke or terminate a user's active session, such as logging out a user from a specific device or session for security or administrative reasons.

For example, if an administrator wants to invalidate a compromised session or enforce logout on a certain device, this operation can be used to delete that session by specifying the user ID and the session ID.

Properties

Name Meaning
User ID The unique identifier of the user whose session you want to delete.
Session ID The unique identifier of the session to be deleted for the specified user.

Output

The output is a JSON object indicating the success status of the session deletion operation. It typically contains a field success which will be true if the session was successfully deleted.

Example output:

[
  {
    "success": true
  }
]

No binary data output is involved in this operation.

Dependencies

  • Requires an Appwrite API endpoint URL, project ID, and an API key credential configured in n8n.
  • Uses the official Appwrite SDK (node-appwrite) to interact with the Appwrite backend.
  • The node depends on the zAppwriteApi credential to authenticate requests.

Troubleshooting

  • Common issues:

    • Invalid or missing User ID or Session ID parameters will cause the operation to fail.
    • Authentication errors if the API key or project credentials are incorrect or expired.
    • Attempting to delete a session that does not exist or already deleted may result in an error.
  • Error messages:

    • "Resource not found": This indicates the specified resource (user or session) could not be found. Verify the User ID and Session ID values.
    • Authentication errors usually mention invalid credentials or unauthorized access; ensure the API key and project ID are correct.
  • Resolution tips:

    • Double-check the User ID and Session ID inputs.
    • Confirm that the API key has sufficient permissions to manage user sessions.
    • Use the "List User Sessions" operation first to retrieve valid session IDs before attempting deletion.

Links and References

Discussion