Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Overview

This node operation allows users to create multiple Role entities in a system that manages roles and permissions. It is useful when you need to add several roles at once, for example, setting up different user groups like "Interns," "Customers," or other custom roles with specific access rights. This batch creation saves time compared to creating each role individually.

Properties

Name Meaning
Data (JSON) An array of partial role objects to be created. Each object can include properties such as name, icon, description, admin access flag, and app access flag. Example: an array of roles with their respective attributes.

Output

The output will contain JSON data representing the newly created roles. Each item in the output corresponds to one role object that was created, including its assigned properties and any system-generated fields like IDs. The node does not explicitly mention binary data output.

Dependencies

  • Requires connection to a Directus API or similar backend service managing roles.
  • Needs appropriate API authentication credentials configured in n8n to authorize role creation.
  • The node depends on internal methods and routing logic bundled within the node's codebase but no external npm packages are explicitly required beyond those.

Troubleshooting

  • Invalid JSON input: If the "Data (JSON)" property contains malformed JSON, the node will fail. Ensure the JSON array is correctly formatted.
  • Missing required fields: Each role object should have necessary fields like name. Omitting required fields may cause API errors.
  • Authentication errors: If the API key or token is missing or invalid, the node will not be able to create roles.
  • API limits or permission issues: The user associated with the API credentials must have permission to create roles; otherwise, the request will be denied.

Links and References

Discussion