DatoCMS icon

DatoCMS

Interact with DatoCMS API

Overview

This node integrates with the DatoCMS API to manage file uploads within a workflow. Specifically, the Upload - Delete operation allows users to delete an existing upload (file) from their DatoCMS project by specifying its unique Upload ID.

Common scenarios where this node is beneficial include:

  • Automating cleanup of unused or outdated media files in DatoCMS.
  • Managing storage by programmatically removing uploads that are no longer needed.
  • Integrating with workflows that handle content lifecycle, ensuring associated media is deleted when content is removed.

Practical example:

  • After deleting a record referencing an image, use this node to delete the corresponding upload by providing the Upload ID, keeping the media library tidy.

Properties

Name Meaning
Upload ID The unique identifier of the upload to delete. This is required to specify which file should be removed from DatoCMS.

Output

The output JSON contains the response from the DatoCMS API after attempting to delete the specified upload. Typically, this will confirm successful deletion or provide error details if the operation failed.

No binary data is output by this operation.

Example output structure (simplified):

{
  "json": {
    // Confirmation or details about the deleted upload
  }
}

Dependencies

  • Requires an API authentication token credential for DatoCMS to authorize requests.
  • Uses the official DatoCMS Node.js client library internally.
  • No additional environment variables are necessary beyond the API credential configuration in n8n.

Troubleshooting

  • Error: Upload ID is missing or invalid
    Ensure the "Upload ID" property is provided and corresponds to an existing upload in your DatoCMS project.

  • API Authentication Errors
    If the node fails due to authentication issues, verify that the API key credential is correctly configured and has sufficient permissions to delete uploads.

  • Insufficient Permissions
    The API user must have rights to delete uploads. Lack of permissions will cause errors; check your DatoCMS user roles and API token scopes.

  • Network or API Errors
    Temporary network issues or API downtime can cause failures. Retry the operation or check DatoCMS status.

Links and References

Discussion