Directus (denkhaus) icon

Directus (denkhaus)

Consume Directus API

Overview

This n8n node updates an existing "Preset" in a Directus system. It is designed to modify the properties of a preset by specifying its unique ID and providing new data in JSON format. This node is useful when you need to programmatically update presets, such as changing layout configurations or other preset attributes, within automated workflows.

Practical examples:

  • Automatically updating dashboard layouts for users after a schema change.
  • Modifying preset filters or views based on user input or external triggers.

Properties

Name Meaning
ID Primary key of the preset. This uniquely identifies which preset will be updated (e.g., "39").
Data (JSON) A partial preset object. The JSON should contain the fields to update, such as layout, filters, etc. Example:
json { "layout": "tabular" }

Output

The output will be a JSON object representing the updated preset. The structure will typically include all preset fields returned by the Directus API, such as:

{
  "id": "39",
  "layout": "tabular",
  // ...other preset fields
}

If the node supports binary data, it is not relevant for this operation.

Dependencies

  • Directus API: Requires access to a Directus instance.
  • Authentication: May require an API key or credentials configured in n8n for Directus.

Troubleshooting

  • Invalid ID: If the provided ID does not correspond to an existing preset, the node may return a "Not Found" error.
  • Malformed JSON: If the "Data (JSON)" property is not valid JSON, the node will throw a parsing error.
  • Permission Denied: If the API credentials do not have permission to update presets, an authorization error will occur.

Links and References

Discussion