Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Overview

The node is designed to update multiple permission records in a system that manages permissions (likely Directus, based on the linked documentation). It allows users to specify an array of primary keys identifying which permission entries to update and provides new data for those entries. This operation is useful when you need to batch update several permission records at once, such as changing access rights or modifying permission attributes across multiple roles or users.

Practical examples include:

  • Updating the read/write access fields for multiple permissions simultaneously.
  • Changing the scope or conditions of several permission entries in bulk without updating them one by one.

Properties

Name Meaning
Data (JSON) A JSON object containing two required properties:
- keys: An array of primary keys identifying the permissions to update.
- data: An object with any subset of the permission object's properties to apply as updates.

Example value for "Data (JSON)":

{
  "keys": [34, 65],
  "data": {
    "fields": ["id", "title", "body"]
  }
}

Output

The output will contain a JSON field representing the result of the update operation. Typically, this would include confirmation of the updated records or the updated permission objects themselves. The exact structure depends on the underlying API response but generally reflects the state of the updated permissions after the operation.

There is no indication that the node outputs binary data.

Dependencies

  • Requires connection to the Directus API or a similar permissions management backend.
  • Needs appropriate API authentication credentials (e.g., an API key or token) configured in n8n to authorize the update requests.
  • The node relies on bundled methods and routing logic internally but does not require additional external libraries beyond what is included.

Troubleshooting

  • Common issues:
    • Providing invalid or non-existent primary keys in the keys array may cause errors or no updates.
    • Malformed JSON in the data property can lead to parsing errors.
    • Insufficient permissions or incorrect API credentials will result in authorization errors.
  • Error messages:
    • Errors related to missing required fields (keys or data) should be checked and corrected.
    • API errors indicating unauthorized access suggest verifying the API key or token.
    • Validation errors from the API might occur if the data contains invalid fields or values; consult the permission object schema.

Links and References

Discussion