Directus (denkhaus) icon

Directus (denkhaus)

Consume Directus API

Overview

The "Role - Create Multiple" operation in this custom n8n node allows users to create several roles at once within a Directus system. This is particularly useful for administrators who need to set up multiple user roles efficiently, such as when onboarding new teams or configuring access levels for different user groups. For example, you might use this node to batch-create roles like "Interns," "Customers," or "Managers," each with specific permissions and attributes.

Properties

Name Meaning
Data (JSON) An array of partial role objects. Each object should define properties such as name, icon, description, admin_access, and app_access.

Output

  • The output will be a JSON field containing the details of the created roles. Each item in the output array corresponds to a role that was successfully created, reflecting the structure and fields provided in the input.

Dependencies

  • Requires access to a Directus instance.
  • Appropriate API credentials or authentication must be configured in n8n to allow role creation.

Troubleshooting

  • Invalid JSON Input: If the "Data (JSON)" property is not a valid JSON array, the node may throw an error. Ensure your input matches the expected format.
  • Missing Required Fields: If any required fields for a role are missing, Directus may reject the request. Refer to the Directus Role Object documentation for required fields.
  • Authentication Errors: If API credentials are incorrect or missing, the node will fail to connect to Directus.

Links and References

Discussion