Directus icon

Directus

Consume Directus API

Overview

This node integrates with the Directus API to manage various resources, including Webhooks. Specifically, for the Webhooks resource and the Delete Multiple operation, it allows users to delete multiple webhooks at once by specifying an array of webhook primary keys.

This operation is beneficial when you need to clean up or remove several webhooks in bulk without making individual delete requests for each webhook. For example, if you have a list of obsolete or unused webhook IDs, you can delete them all in one go, saving time and reducing API calls.

Properties

Name Meaning
Keys (JSON) An array of webhook primary keys to be deleted. Example: [2, 15, 41]. This property is required.

Output

The output of this operation is a JSON object representing the response from the Directus API after attempting to delete the specified webhooks. The structure typically includes information about the deletion result, such as success status or details of deleted items.

If the API returns a simple confirmation or status message, it will be included in the json output field. There is no binary data output associated with this operation.

Dependencies

  • Requires an active connection to the Directus API via an API key credential configured in n8n.
  • The node uses the Directus REST API endpoints to perform operations.
  • Proper permissions on the Directus instance are necessary to delete webhooks.

Troubleshooting

  • Invalid Keys Format: Ensure that the "Keys (JSON)" input is a valid JSON array of numeric or string IDs. Malformed JSON or incorrect types will cause errors.
  • Permission Denied: If the API user lacks permission to delete webhooks, the request will fail. Verify API credentials and user roles.
  • Webhook Not Found: If any specified webhook ID does not exist, the API may return an error or partial success. Check that all keys are correct.
  • API Connectivity Issues: Network problems or incorrect API URL/credentials will prevent successful execution.
  • Error Messages: Errors thrown by the node will include messages from the Directus API. Use these messages to diagnose issues like invalid parameters or authentication failures.

To resolve errors:

  • Validate the JSON input carefully.
  • Confirm API credentials and permissions.
  • Check the existence of webhook IDs before deletion.
  • Enable "Continue On Fail" in the node settings to handle partial failures gracefully.

Links and References

Discussion