Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Overview

The node provides functionality to delete multiple files in a batch operation. This is useful when you need to remove several files at once from a system or service that manages file storage, such as a content management backend or digital asset manager. For example, if you have a list of file identifiers that are no longer needed, you can pass them all at once to this node to efficiently clean up storage.

Properties

Name Meaning
Keys (JSON) An array of primary keys (identifiers) of the files you want to delete. Example: ["id1", "id2"]

Output

The output will contain a JSON object indicating the result of the deletion operation. Typically, this might include confirmation of which files were deleted or any errors encountered for specific keys. The exact structure depends on the underlying API response but generally confirms successful removal of the specified files.

No binary data output is expected from this operation since it deals with deletion.

Dependencies

  • Requires an API key or authentication token to access the file management service.
  • Depends on the external service's API that supports batch deletion of files by their primary keys.
  • The node uses internal routing and method loading mechanisms to perform the operation, relying on bundled methods and action descriptions.

Troubleshooting

  • Invalid or missing keys: If the provided keys array is empty or contains invalid identifiers, the operation may fail or skip deletions. Ensure the keys are valid and correspond to existing files.
  • Authentication errors: Failure due to missing or incorrect API credentials will prevent deletion. Verify that the API key or authentication token is correctly configured.
  • Partial failures: Some files might not be deleted if they do not exist or are locked. Check the output for error messages related to individual keys.
  • Malformed JSON input: The keys property expects a valid JSON array. Invalid JSON syntax will cause errors before execution.

Links and References

  • Refer to the external file management API documentation for details on batch deletion endpoints.
  • Consult n8n documentation on how to configure API credentials and use JSON input properties effectively.

Discussion