ONLYOFFICE DocSpace icon

ONLYOFFICE DocSpace

Consume ONLYOFFICE DocSpace API

File → Move File

AI-generated

Summary

Moves a single file in ONLYOFFICE DocSpace to a target room or folder, or to the authenticated user's "My documents" section, and returns the moved file's record.

Inputs

  • Authentication (required) — Credential type used for the request: API Key, Basic Auth, OAuth2, or Personal Access Token. Defaults to API Key.
  • File ID (required) — Numeric ID of the file to move.
  • To My Documents (required) — If true, the file is moved to the authenticated user's "My documents" folder. The node looks up that folder's ID via the API. Defaults to false.
  • Destination ID (required) — Numeric ID of the destination room or folder. Shown and used only when To My Documents is false.

Output shape

One item per input item, containing the JSON record of the moved file (the first file in the completed move operation's result).

The move is asynchronous on the DocSpace side. The node polls the file operations endpoint up to 20 times at 100 ms intervals and throws on an operation error or timeout. The conflict resolution mode is fixed to 'Duplicate', so a name collision at the destination creates a duplicate rather than overwriting. With Continue On Fail enabled, a failed item returns {error: message}.

Examples

Example 1: Archive a processed file by moving it into a specific room folder.

File ID = {{$json.id}}, To My Documents = false, Destination ID = 12345.

Example 2: Move a file from a shared room into the user's personal space.

File ID = 678, To My Documents = true.

Links

Discussion