Directus (DrWade) icon

Directus (DrWade)

Consume Directus API

Activity → Delete

AI-generated

Overview

The Activity → Delete operation in this n8n node is designed to delete a specific comment from the Directus Activity resource. This is achieved by providing the unique identifier (ID) of the comment you wish to remove. The node interacts with the Directus API to perform the deletion.

Common scenarios:

  • Removing outdated or incorrect comments from activity logs.
  • Automating cleanup of activity records as part of workflow maintenance.
  • Integrating with other systems to synchronize deletions based on external triggers.

Practical example:
Suppose you have an automated moderation system that flags inappropriate comments. You can use this node to automatically delete flagged comments from the Directus activity log.


Properties

Name Type Meaning
ID Number Unique identifier for the object (comment) to be deleted. Required.

Output

  • The output will be a single field:
    • json: Contains the response from the Directus API after attempting to delete the specified comment. The structure may vary depending on the API's response, but typically it will either confirm the deletion or provide details if the item was not found or could not be deleted.

Example output:

{
  "json": {
    // Response data from Directus API, e.g., success message or error details
  }
}

Dependencies

  • Directus API: Requires access to a running Directus instance.
  • API Credentials: The node requires valid Directus API credentials (directusApi) configured in n8n.

Troubleshooting

Common issues:

  • Invalid ID: If the provided ID does not correspond to an existing comment, the API may return an error indicating that the resource was not found.
  • Insufficient Permissions: The API credentials used must have permission to delete activity comments; otherwise, a permissions error will occur.
  • Network/API Errors: Connectivity issues or misconfigured API endpoints can result in failed requests.

Error messages and resolutions:

  • "error": "Not Found": Ensure the ID is correct and the comment exists.
  • "error": "Forbidden" or "error": "Unauthorized": Check your API credentials and user permissions in Directus.
  • "error": "Request failed with status code XXX": Review the full error message for more context; check network connectivity and API endpoint configuration.

Links and References

Discussion