Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

File → Delete

AI-generated

Overview

This node deletes a file object in the Directus system based on a unique file ID provided as input. It is useful for scenarios where you need to programmatically remove files from your Directus-managed storage, such as cleaning up unused files or managing file lifecycle automatically.

Use Case Examples

  1. Deleting a file by its unique ID to free up storage space.
  2. Automating file removal as part of a workflow when a related record is deleted.

Properties

Name Meaning
ID Unique ID of the file object to be deleted

Output

JSON

  • success - Indicates whether the file deletion was successful
  • message - Additional information or error message related to the deletion operation

Dependencies

  • Requires an API key credential or authentication token to access the Directus API.

Troubleshooting

  • Ensure the provided file ID is correct and exists in the Directus system; otherwise, the deletion will fail.
  • Check that the API credentials have sufficient permissions to delete files.
  • Common error messages include 'File not found' if the ID is invalid, or 'Unauthorized' if authentication fails.

Links

Discussion