Directus icon

Directus

Consume Directus API

Overview

This node integrates with the Directus API to manage user data within a Directus instance. Specifically, for the Users resource and the Delete operation, it allows you to delete a user by their unique identifier (ID). This is useful in scenarios where you need to programmatically remove users from your Directus-managed system, such as automating user lifecycle management or cleaning up inactive accounts.

Practical example:
You might use this node in an automation workflow that deletes users who have not logged in for a certain period or removes test users after a batch import.

Properties

Name Meaning
ID The primary key (unique identifier) of the user to be deleted. This is a required string property. Example format: 72a1ce24-4748-47de-a05f-ce9af3033727.

Output

The output of the node is a JSON object representing the response from the Directus API after attempting to delete the specified user. Typically, this will include confirmation details or status information about the deletion operation.

  • The output JSON structure corresponds to the Directus API's response data for deleting a user.
  • No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to a Directus instance via an API key credential configured in n8n.
  • The node uses the Directus REST API endpoints and expects proper authentication credentials to be set up.
  • No additional external dependencies beyond the Directus API and its authentication are needed.

Troubleshooting

  • Common issues:

    • Invalid or missing user ID: Ensure the provided ID matches an existing user in Directus.
    • Authentication errors: Verify that the API key credential is valid and has sufficient permissions to delete users.
    • Network or connectivity problems: Confirm that the Directus server is reachable from the n8n environment.
  • Error messages:

    • Errors returned from the Directus API will be passed through. For example, "User not found" if the ID does not exist.
    • Authentication failures may result in unauthorized or forbidden errors.
    • To handle errors gracefully, enable the "Continue On Fail" option in the node settings to prevent workflow interruption.

Links and References

Discussion