Directus (denkhaus) icon

Directus (denkhaus)

Consume Directus API

Overview

This node is designed to delete multiple roles in a Directus system by their primary keys. It is useful in scenarios where you need to bulk-remove user roles, such as cleaning up unused roles or automating role management tasks. For example, you might use this node to remove several deprecated roles after an organizational change.

Properties

Name Meaning
Keys (JSON) An array of role primary keys to be deleted. Example: ["653925a9-970e-487a-bfc0-ab6c96affcdc", "c86c2761-65d3-43c3-897f-6f74ad6a5bd7"]

Output

The output will contain the result of the deletion operation for each provided role key. The structure typically includes information about which roles were successfully deleted and may include error details if any deletions failed.

Example output:

[
  {
    "id": "653925a9-970e-487a-bfc0-ab6c96affcdc",
    "status": "deleted"
  },
  {
    "id": "c86c2761-65d3-43c3-897f-6f74ad6a5bd7",
    "status": "deleted"
  }
]

If binary data is returned, it would represent the raw response from the API, but this operation is expected to return JSON only.

Dependencies

  • Requires access to a Directus instance with appropriate permissions to delete roles.
  • May require an API key or authentication credentials configured in n8n.

Troubleshooting

  • Invalid or missing keys: If the "Keys (JSON)" property is empty or contains invalid IDs, the node may throw an error indicating that the input is not valid. Ensure you provide a valid JSON array of existing role IDs.
  • Permission errors: If the connected Directus account does not have permission to delete roles, you may receive an authorization error. Check your Directus user permissions.
  • Role not found: If one or more provided keys do not correspond to existing roles, the output may indicate which deletions failed.

Links and References

Discussion