Directus (DrWade) icon

Directus (DrWade)

Consume Directus API

Overview

The Directus (DrWade) n8n node for the resource Permissions with the operation Delete allows users to delete a specific permission rule from a Directus instance by its primary key (ID). This is useful in scenarios where you need to programmatically manage and clean up permissions, such as removing outdated or unnecessary access rules as part of an automated workflow.

Practical examples:

  • Automatically revoke permissions when a user leaves a team.
  • Clean up temporary access rules after a project phase is completed.
  • Integrate with approval workflows to remove permissions upon rejection.

Properties

Name Type Meaning
ID String Primary key of the permission rule to delete. Required. Example: "34"

Output

  • The output will be a single object per input item, under the json field.
  • The structure of the output depends on the response from the Directus API after deleting the permission. Typically, it may return an empty object {} or a confirmation of deletion.
  • If an error occurs and "Continue On Fail" is enabled, the output will contain an error property with the error message.

Example output:

{
  "json": {}
}

or, on error:

{
  "json": {
    "error": "Permission not found"
  }
}

Dependencies

  • Directus API: Requires access to a Directus instance.
  • API Credentials: You must configure the directusApi credentials in n8n for authentication.

Troubleshooting

Common issues:

  • Invalid ID: If the provided ID does not correspond to an existing permission, the API will likely return an error such as "Permission not found".
  • Insufficient Permissions: The API credentials used must have sufficient rights to delete permissions; otherwise, you may receive a "Forbidden" or "Unauthorized" error.
  • Network/API Errors: Connectivity issues or incorrect API endpoint configuration can result in errors.

Error handling:

  • If "Continue On Fail" is enabled, errors are returned in the output under the error property.
  • Otherwise, the workflow execution will stop on error.

Links and References

Discussion