Directus (DrWade) icon

Directus (DrWade)

Consume Directus API

Webhooks → Delete

AI-generated

Overview

The Webhooks → Delete operation in this n8n node allows you to delete a specific webhook from your Directus instance by its unique identifier. This is useful for managing and cleaning up webhooks that are no longer needed, ensuring your Directus project only has active and relevant integrations.

Common scenarios:

  • Removing obsolete or test webhooks.
  • Automating the cleanup of webhooks as part of a deployment or offboarding process.
  • Ensuring security by deleting unused endpoints.

Example use case:
You have a workflow that automatically deletes webhooks after a certain period or when a related resource is removed from your system.


Properties

Name Type Meaning
ID String Primary key of the webhook to be deleted. Required.

Output

  • The output will be a JSON object containing the result of the deletion request.
  • If the deletion is successful, the response may be an empty object or contain metadata about the deleted webhook, depending on the Directus API's behavior.
  • If an error occurs and "Continue On Fail" is enabled, the output will include an error field with the error message.

Example output:

{
  "id": "15",
  // ...other fields if returned by Directus
}

or, on error (with continue on fail):

{
  "error": "Webhook not found"
}

Dependencies

  • Directus API: Requires access to a Directus instance.
  • API Credentials: You must configure the directusApi credentials in n8n for authentication.

Troubleshooting

Common issues:

  • Invalid ID: If the provided ID does not correspond to an existing webhook, the API will return an error such as "Webhook not found".
  • Insufficient permissions: The API credentials used must have permission to delete webhooks; otherwise, you may receive a "Forbidden" or "Unauthorized" error.
  • Network/API errors: Connectivity issues or incorrect API base URLs can cause failures.

Error messages and resolutions:

  • "Webhook not found": Double-check the ID value.
  • "Forbidden" or "Unauthorized": Ensure your API credentials have the correct permissions.
  • "Cannot read property 'data' of undefined": Indicates an unexpected API response; check your Directus version and API endpoint.

Links and References

Discussion