ONLYOFFICE DocSpace icon

ONLYOFFICE DocSpace

Consume ONLYOFFICE DocSpace API

File → Delete File

AI-generated

Summary

Deletes a file in ONLYOFFICE DocSpace by its numeric ID and returns the file's info as it was just before deletion.

Inputs

  • Authentication (required) — Credential type used for the request: API Key, Basic Auth, OAuth2, or Personal Access Token. The matching credential must be configured.
  • File ID (required) — Numeric ID of the file to delete.

Output shape

One JSON item per input item, containing the file's metadata object (as returned by DocSpace's file info endpoint) fetched before the delete.

The node first GETs the file info, then sends a DELETE with deleteAfter=false and immediately=false. It then polls the DocSpace file operations status (up to 20 times, 100 ms apart) until the delete finishes. It throws an error if the operation reports errors or times out. The returned data is the pre-deletion snapshot, not a confirmation payload. With 'Continue On Fail' enabled, a failed item returns {error: message}. Because immediately is false, the file is probably moved to trash instead of being permanently erased, but the source doesn't confirm this.

Examples

Example 1: Delete a known file and keep a record of its details

Authentication: API Key; File ID: 12345. The output holds the file's title, extension, and other metadata.

Example 2: Clean up files whose IDs come from an earlier step

File ID set by expression, e.g. {{ $json.id }}, so the node deletes one file per incoming item.

Links

Discussion