Actions109
- Activity Actions
- Assets Actions
- Authentication Actions
- Collections Actions
- Extensions Actions
- Fields Actions
- Files Actions
- Folders Actions
- Items Actions
- Permissions Actions
- Presets Actions
- Relations Actions
- Revisions Actions
- Roles Actions
- Settings Actions
- Users Actions
- Utilities Actions
- Webhooks Actions
Overview
This node integrates with the Directus API to manage users and other resources. Specifically, for the Users resource with the Delete Multiple operation, it allows you to delete multiple user records at once by providing an array of user primary keys.
Common scenarios where this node is beneficial include:
- Bulk removal of user accounts from a Directus-managed system.
- Automated cleanup of inactive or test users.
- Managing user lifecycle in workflows that require batch deletions.
For example, if you have a list of user IDs that need to be removed due to inactivity, you can pass them as a JSON array to this node's "Keys (JSON)" property to delete all those users in one API call.
Properties
| Name | Meaning |
|---|---|
| Keys (JSON) | An array of user primary keys (UUIDs or IDs) specifying which users to delete. Example: ["653925a9-970e-487a-bfc0-ab6c96affcdc", "c86c2761-65d3-43c3-897f-6f74ad6a5bd7"] |
Output
The output of this operation is a JSON object representing the response from the Directus API after attempting to delete the specified users. Typically, this will contain information about the success or failure of the deletion request.
The structure generally includes:
- Confirmation of deleted user keys or count.
- Any error messages if deletion failed for some or all users.
No binary data is produced by this operation.
Dependencies
- Requires a valid connection to a Directus instance via an API key credential configured in n8n.
- The node uses the Directus REST API endpoint for users (
DELETE /users) with a payload containing the keys to delete. - Proper permissions on the Directus API are necessary to perform bulk deletions of users.
Troubleshooting
- Invalid Keys Format: Ensure the "Keys (JSON)" input is a valid JSON array of user IDs. Malformed JSON or incorrect data types will cause errors.
- Permission Denied: If the API credentials lack permission to delete users, the API will return an authorization error.
- Partial Deletion: If some user keys do not exist or cannot be deleted, the response may indicate partial success. Review the response for details.
- API Connectivity Issues: Network problems or incorrect API URL/credentials will result in connection errors.
- To resolve errors, verify the API credentials, ensure the keys are correct and exist, and check the Directus API documentation for required permissions.