Directus (denkhaus) icon

Directus (denkhaus)

Consume Directus API

Overview

This n8n node is designed to create a new Role in a Directus system. It allows users to define the properties of a role (such as its name, icon, description, and access permissions) by providing a JSON object. This node is useful for automating user management workflows, such as onboarding new teams or setting up access controls programmatically.

Practical examples:

  • Automatically creating a "Guest" or "Intern" role with limited permissions when a new project is initialized.
  • Setting up roles as part of an automated deployment or configuration process for a Directus instance.

Properties

Name Meaning
Data (JSON) A partial role object. You provide the details of the role to be created, such as name, icon, description, admin_access, and app_access.

Output

The output will contain the JSON representation of the newly created role object, reflecting the data you provided plus any additional fields set by Directus (such as unique identifiers or timestamps).

Example output:

{
  "id": "unique-role-id",
  "name": "Interns",
  "icon": "verified_user",
  "description": null,
  "admin_access": false,
  "app_access": true,
  // ...other fields managed by Directus
}

Dependencies

  • Requires access to a Directus instance with appropriate API credentials and permissions to create roles.
  • The n8n node may require configuration of authentication (API key, token, or OAuth) depending on your Directus setup.

Troubleshooting

  • Missing or invalid Data (JSON): If the required fields are missing or the JSON is malformed, the node may throw an error indicating invalid input. Ensure your JSON matches the expected structure for a Directus role object.
  • Insufficient permissions: If the API credentials do not have permission to create roles, you may receive an authorization error from Directus.
  • Network/API errors: Connectivity issues or incorrect Directus endpoint URLs can result in request failures.

Links and References

Discussion