Directus icon

Directus

Consume Directus API

Overview

The node integrates with the Directus API, allowing users to perform various operations on different Directus resources. Specifically, for the Presets resource and the Update Multiple operation, this node enables updating multiple preset records in bulk by sending a PATCH request with specified keys and data fields to update.

This is beneficial when you need to modify several presets at once without making individual update calls for each preset. For example, if you want to change the layout property of multiple presets identified by their primary keys, you can do so efficiently using this operation.

Properties

Name Meaning
Data (JSON) A JSON object containing two required properties:
- keys: An array of primary keys identifying the presets to update.
- data: An object with any of the preset properties to be updated.
Example:
json { "keys": [15, 64], "data": { "layout": "tabular" } }

Output

The output is an array of JSON objects representing the response from the Directus API after attempting to update the specified presets. The structure corresponds to the updated preset objects or the API's response format for bulk updates.

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to a Directus instance via an API key credential.
  • The node uses the Directus REST API endpoints and expects proper authentication credentials configured in n8n.
  • No additional external dependencies are needed beyond the Directus API access.

Troubleshooting

  • Invalid JSON in Data (JSON) property: If the JSON provided is malformed, the node will throw a parsing error. Ensure the JSON syntax is correct.
  • Missing keys or data fields: Both keys and data must be present in the JSON input; otherwise, the API call may fail or not update anything.
  • API authentication errors: If the API key or credentials are invalid or expired, the node will return authentication errors. Verify your Directus API credentials.
  • Permission issues: The authenticated user must have permission to update presets; otherwise, the API will reject the request.
  • Network or connectivity problems: Ensure that the Directus server is reachable from the n8n environment.

Links and References

Discussion