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
Permissions → Delete Multiple
AI-generatedOverview
The Directus (DrWade) n8n node for the resource Permissions with the operation Delete Multiple allows users to delete multiple permission records in a Directus instance at once. This is particularly useful for administrators or automation workflows that need to clean up or manage permissions in bulk, such as removing access rights for deprecated roles or cleaning up after user offboarding.
Practical Example:
Suppose you have a list of permission IDs that are no longer needed. By providing these IDs as an array, this node will send a single request to Directus to remove all specified permissions efficiently, rather than deleting them one by one.
Properties
| Name | Type | Meaning |
|---|---|---|
| Keys (JSON) | JSON | An array of permission primary keys to be deleted. Example: [34, 64]. Required field. |
Output
- The output will be a single object with a
jsonproperty. - The structure of the
jsonfield will contain the response from the Directus API after attempting to delete the specified permissions. Typically, this may include:- A summary of the deletion result (e.g., number of items deleted, status).
- If the API returns data about the deleted permissions, it will be included here.
- In case of error and if "Continue On Fail" is enabled, the output will contain an
errorfield with the error message.
Example Output:
{
"json": {
// Response from Directus, e.g.,
"data": [
{ "id": 34, "status": "deleted" },
{ "id": 64, "status": "deleted" }
]
}
}
Or, on error (with continue on fail):
{
"json": {
"error": "Permission not found"
}
}
Dependencies
- External Service: Requires access to a Directus instance.
- Authentication: Needs valid Directus API credentials configured in n8n under the name
directusApi. - n8n Configuration: No special environment variables beyond standard credential setup.
Troubleshooting
Common Issues:
- Invalid Keys Format: Ensure the "Keys (JSON)" property is a valid JSON array of numeric IDs. Invalid JSON or wrong data types will cause errors.
- Non-existent Permission IDs: If any provided ID does not exist, Directus may return an error or partial success depending on its API behavior.
- Insufficient Permissions: The API credentials used must have permission to delete permissions; otherwise, an authorization error will occur.
Error Messages & Resolutions:
"Unexpected token ... in JSON": The input for "Keys (JSON)" is not valid JSON. Double-check your syntax."Permission not found": One or more IDs do not correspond to existing permissions. Verify the IDs."Unauthorized"or"Forbidden": The API credentials lack sufficient rights. Update the credentials or their permissions in Directus.
Links and References
- Directus Permissions API Documentation
- n8n Credentials Documentation
- n8n Directus Node Docs (if available)