Actions109
- Collections Actions
- Activity Actions
- Assets Actions
- Authentication 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
The Users → Delete Multiple operation in this n8n node allows you to delete multiple user records from a Directus instance in a single API call. This is particularly useful for bulk user management tasks, such as cleaning up test accounts, removing users who no longer need access, or automating deprovisioning processes.
Practical examples:
- Removing a list of users whose IDs are known (e.g., after an export from another system).
- Automating the deletion of users based on certain criteria in a workflow.
- Cleaning up inactive or duplicate user accounts in batch.
Properties
| Name | Type | Meaning |
|---|---|---|
| Keys (JSON) | json | An array of user primary keys (IDs) to be deleted. Example: ["id1", "id2", ...]. Required. |
Output
- The output will be a JSON object reflecting the response from the Directus API after attempting to delete the specified users.
- The structure typically includes a
datafield, which may contain information about the deleted users or confirmation of the deletion. - If an error occurs and "Continue On Fail" is enabled, the output will include an
errorfield with the error message.
Example output:
{
"data": [
// Details about deleted users or confirmation objects
]
}
or, in case of error:
{
"error": "Error message describing what went wrong"
}
Dependencies
- Directus API: Requires access to a running Directus instance.
- API Credentials: You must configure the
directusApicredentials in n8n for authentication.
Troubleshooting
Common issues:
- Invalid or missing user IDs: If any of the provided keys do not correspond to existing users, the API may return an error.
- Insufficient permissions: The API credentials used must have permission to delete users; otherwise, a permission error will occur.
- Malformed JSON: The "Keys (JSON)" property must be a valid JSON array of strings. Invalid JSON will cause parsing errors.
Common error messages:
"Invalid credentials": Check your Directus API credentials configuration."User not found": One or more user IDs do not exist."Permission denied": The authenticated user does not have rights to delete users."Unexpected token": The input for "Keys (JSON)" is not valid JSON.
How to resolve:
- Double-check the format of the "Keys (JSON)" input.
- Ensure all user IDs exist in Directus.
- Verify that your API credentials have sufficient permissions.