Directus (denkhaus) icon

Directus (denkhaus)

Consume Directus API

Overview

The "Webhook - Update Multiple" operation in this custom n8n node allows users to update several webhook records at once in a Directus system. This is particularly useful for batch-editing webhooks, such as changing their names, URLs, or other properties without having to update each one individually.

Common scenarios:

  • Renaming multiple webhooks in bulk.
  • Updating the status or configuration of several webhooks at once.
  • Automating webhook management tasks as part of larger workflows.

Practical example:
Suppose you have 10 webhooks that need to be disabled temporarily. Instead of updating each webhook manually, you can use this node to update all relevant webhooks in a single operation by specifying their primary keys and the new status.

Properties

Name Meaning
Data (JSON) JSON object containing:
- keys: Array of primary keys of the webhooks you'd like to update.
- data: An object with any properties of the webhook object you wish to update. See Directus Webhook Object for available fields.

Output

The output will be a json field containing the result of the update operation. Typically, this includes information about the updated webhook records, such as their IDs and the new values of the updated fields.

Example output:

{
  "data": [
    {
      "id": 15,
      "name": "Build Website"
    },
    {
      "id": 41,
      "name": "Build Website"
    }
  ]
}

Note: The actual structure may vary depending on the Directus API response.

Dependencies

  • External Service: Requires access to a Directus instance with appropriate permissions to update webhooks.
  • API Key/Authentication: The node must be configured with credentials that allow updating webhooks in Directus.
  • n8n Configuration: Ensure the node is properly authenticated and connected to your Directus environment.

Troubleshooting

Common issues:

  • Invalid Primary Keys: If the provided keys array contains IDs that do not exist, those webhooks will not be updated.
  • Malformed JSON: If the Data (JSON) property is not valid JSON, the node will throw an error.
  • Insufficient Permissions: If the API credentials lack permission to update webhooks, the operation will fail.

Common error messages and resolutions:

  • "Invalid JSON input": Check that the Data (JSON) field contains properly formatted JSON.
  • "Permission denied": Verify that the API key or user has sufficient rights to update webhooks in Directus.
  • "Not found": Ensure the IDs in the keys array correspond to existing webhooks.

Links and References

Discussion