Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Collection → Delete

AI-generated

Overview

This node deletes a specified collection in the Directus system. It is useful for scenarios where you need to programmatically remove entire collections of data, such as cleaning up unused or obsolete collections in a database. For example, if you have a collection named 'articles' that is no longer needed, this node can delete it by specifying the collection name.

Use Case Examples

  1. Deleting a collection named 'articles' to remove all associated data and schema from the Directus database.
  2. Automating cleanup of test collections created during development by deleting them after tests complete.

Properties

Name Meaning
Collection Name Unique name of the collection to be deleted

Output

JSON

  • success - Indicates whether the collection was successfully deleted (true/false)
  • message - Additional information or error message related to the deletion operation

Dependencies

  • Directus API authentication token or credentials

Troubleshooting

  • Ensure the collection name provided exists; otherwise, the deletion will fail with an error.
  • Verify that the API credentials have sufficient permissions to delete collections.
  • Common error messages include 'Collection not found' if the name is incorrect, or 'Permission denied' if the credentials lack delete rights.

Links

Discussion