Directus icon

Directus

Consume Directus API

Overview

This node integrates with the Directus API to manage permissions among other resources. Specifically, for the Permissions resource and the Delete operation, it allows users to delete a permission rule by its primary key (ID). This is useful in scenarios where you want to programmatically remove access rules or restrictions from your Directus instance.

Practical examples include:

  • Automating cleanup of outdated or obsolete permission rules.
  • Managing user roles and their permissions dynamically based on external triggers.
  • Integrating permission management into larger workflows that require conditional access control updates.

Properties

Name Meaning
ID The primary key of the permission rule to delete. This uniquely identifies which permission will be removed. It is a required string input.

Output

The output JSON contains the response from the Directus API after attempting to delete the specified permission. Typically, this will include confirmation of deletion or details about the deleted permission object.

No binary data output is involved in this operation.

Example output structure (simplified):

{
  "json": {
    // Response data confirming deletion or related info
  }
}

Dependencies

  • Requires an active connection to a Directus instance via an API key credential.
  • The node uses the Directus REST API endpoints to perform operations.
  • Proper API credentials must be configured in n8n to authenticate requests.

Troubleshooting

  • Common issues:

    • Invalid or missing permission ID: Ensure the ID provided corresponds to an existing permission rule.
    • Authentication errors: Verify that the API key credential is valid and has sufficient rights to delete permissions.
    • Network or connectivity problems: Confirm that the Directus server is reachable from the n8n environment.
  • Error messages:

    • Errors returned from the Directus API will be passed through. For example, "Permission not found" if the ID does not exist.
    • Authentication failures will typically indicate invalid credentials or insufficient permissions.
  • Resolution tips:

    • Double-check the permission ID input.
    • Confirm API credentials and permissions.
    • Use the "Continue On Fail" option in n8n to handle errors gracefully within workflows.

Links and References


This summary focuses solely on the Permissions resource with the Delete operation as requested.

Discussion