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 Get operation, it retrieves a single permission rule by its unique ID. This is useful when you need to fetch detailed information about a specific permission rule configured in your Directus instance.

Practical scenarios include:

  • Auditing or reviewing a particular permission rule before applying changes.
  • Fetching permission details to display or use in conditional workflows.
  • Integrating permission data into other systems or reports.

Properties

Name Meaning
ID The primary key (unique identifier) of the permission rule to retrieve. This is required to specify which permission to get.

Output

The output is a JSON object representing the permission rule retrieved from Directus. It contains all the fields and metadata associated with that permission rule as returned by the Directus API.

Example structure (simplified):

{
  "id": "34",
  "collection": "articles",
  "action": "read",
  "role": "editor",
  "permissions": { /* detailed permission settings */ },
  "meta": { /* metadata if any */ }
}

No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to a Directus instance via an API key credential.
  • The node uses the Directus REST API endpoints; thus, the Directus server must be accessible.
  • Proper API credentials with permission to read permissions are necessary.

Troubleshooting

  • Error: Permission not found — Occurs if the provided ID does not correspond to any existing permission rule. Verify the ID is correct.
  • Authentication errors — Ensure the API key credential is valid and has sufficient rights.
  • Network issues — Confirm the Directus server URL is reachable from n8n.
  • Malformed ID input — The ID must be a valid string matching the permission's primary key format.

If the node throws an error, enabling "Continue On Fail" can help handle errors gracefully within workflows.

Links and References

Discussion