Directus (DrWade) icon

Directus (DrWade)

Consume Directus API

Overview

The Directus (DrWade) n8n node for the resource Webhooks with the operation Get retrieves detailed information about a specific webhook from a Directus instance, using its unique ID. This is useful in scenarios where you need to fetch and process metadata or configuration details of a webhook that has been previously created in Directus.

Practical examples:

  • Fetching webhook configuration to audit or display its settings.
  • Using webhook details as part of a workflow that manages or synchronizes webhooks across systems.
  • Validating the existence and properties of a webhook before performing updates or deletions.

Properties

Name Type Meaning
ID String Primary key of the webhook to retrieve. This uniquely identifies the webhook in Directus.

Output

  • The output will be a single object in the json field containing all available data for the specified webhook.
  • If the response is not an object, it will be wrapped in { "response": ... }.
  • If the webhook is not found or an error occurs and "Continue On Fail" is enabled, the output will contain { "error": <error message> }.

Example output:

{
  "id": "15",
  "name": "My Webhook",
  "url": "https://example.com/webhook",
  "actions": ["create", "update"],
  "collections": ["articles"],
  "status": "active",
  ...
}

Note: The actual fields depend on your Directus setup and webhook configuration.


Dependencies

  • Directus API: Requires access to a running 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 any webhook, the output may be empty or contain an error message.
  • Authentication errors: If the API credentials are missing or incorrect, the node will fail with an authentication error.
  • Network/API errors: Connectivity issues or misconfigured Directus endpoints can cause failures.

Error messages:

  • "error": "Request failed with status code 404" – The webhook with the given ID does not exist.
  • "error": "Authentication failed" – Check your Directus API credentials in n8n.
  • "error": "<other message>" – Review the error for clues; check network connectivity and Directus server status.

Links and References

Discussion