Directus (denkhaus) icon

Directus (denkhaus)

Consume Directus API

Overview

This node updates an existing folder in a system (likely Directus, based on the code context). It allows you to modify folder details such as its name or parent folder by specifying the folder's unique ID and the fields to update. This is useful for organizing content hierarchies, restructuring folders, or correcting folder metadata.

Common scenarios:

  • Renaming a folder.
  • Moving a folder under a different parent to reorganize structure.
  • Updating multiple folder properties at once via JSON input.

Practical example:
You have a folder named "2023 Reports" that needs to be renamed to "Annual Reports 2023" and moved under a new parent folder called "Archives". You would use this node to update both the name and parent in one operation.

Properties

Name Type Meaning
ID String Unique ID of the folder object to update. Required.
JSON/RAW Parameters Boolean If true, body parameters are provided as raw JSON; if false, use UI fields for updates.
Body Parameters JSON (Shown if JSON/RAW Parameters is true) The full set of body parameters as JSON or RAW.
Update Fields Collection (Shown if JSON/RAW Parameters is false) Individual fields to update, such as Name or Parent.
└ Name String New name for the folder. Cannot be null or empty.
└ Parent String Unique identifier of the parent folder for nesting.

Output

The node outputs a json field containing the updated folder object as returned by the API. The structure typically includes:

  • The folder's unique ID
  • Updated fields (e.g., name, parent)
  • Any other metadata returned by the backend

Example output:

{
  "id": "0fca80c4-d61c-4404-9fd7-6ba86b64154d",
  "name": "Annual Reports 2023",
  "parent": "d97c2e0e-293d-4eb5-9e1c-27d3460ad29d",
  // ...other folder properties
}

Dependencies

  • Requires access to the Directus API (or similar backend).
  • Likely requires authentication (API key, OAuth, etc.) configured in n8n credentials.
  • No additional environment variables specified in the static analysis.

Troubleshooting

Common issues:

  • Invalid Folder ID: If the provided ID does not exist, the API will likely return a "not found" error.
  • Empty or Null Name: Attempting to set the folder name to null or empty will result in a validation error.
  • Permission Denied: Insufficient permissions may cause authorization errors when updating folders.
  • Malformed JSON: If using JSON/RAW Parameters, invalid JSON syntax will cause parsing errors.

Error messages and resolutions:

  • "Folder not found": Check that the ID is correct and the folder exists.
  • "Name can't be null or empty": Ensure the Name field is filled out.
  • "Unauthorized": Verify your API credentials and permissions.
  • "Invalid JSON": Double-check the JSON syntax in Body Parameters.

Links and References

Discussion