Directus icon

Directus

Consume Directus API

Overview

The Directus - Permission: Delete operation in this n8n node allows you to delete a specific permission rule from your Directus instance by its primary key (ID). This is useful for automating the management of access control within your Directus project, such as removing outdated or unnecessary permission rules as part of your workflow.

Common scenarios:

  • Automatically cleaning up permissions when a user or role is removed.
  • Managing permissions as part of deployment or migration scripts.
  • Integrating with other systems to revoke access based on external triggers.

Example:
If you have a permission rule that should be deleted when a certain condition is met (e.g., a user's contract ends), you can use this node in your n8n workflow to automate the deletion process.


Properties

Name Type Meaning
ID String Primary key of the permission rule to delete. Required.

Output

  • The output will be a single object in 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 message, but this can vary depending on the Directus version and configuration.

Example output:

{
  "json": {}
}

or

{
  "json": {
    "message": "Permission deleted successfully"
  }
}

Dependencies

  • External Service: Requires access to a Directus instance.
  • API Credentials: You must configure the directusApi credentials in n8n with appropriate permissions to delete permissions in Directus.

Troubleshooting

Common issues:

  • Invalid ID: If the provided ID does not exist, the node may throw an error indicating that the permission rule was not found.
  • Insufficient Permissions: If the API credentials do not have rights to delete permissions, you may receive a "Forbidden" or "Unauthorized" error.
  • Network/Connection Issues: Errors related to connectivity with the Directus server.

Error messages and resolutions:

  • "Not Found": Check that the ID is correct and exists in your Directus instance.
  • "Forbidden" or "Unauthorized": Ensure your API credentials have sufficient privileges.
  • "Request failed with status code 500": There may be a server-side issue; check Directus logs.

Links and References


Discussion