ONLYOFFICE DocSpace icon

ONLYOFFICE DocSpace

Consume ONLYOFFICE DocSpace API

File → Create File

AI-generated

Summary

Creates a new empty file (document, spreadsheet, presentation, or PDF form) in an ONLYOFFICE DocSpace room or folder, or in the authenticated user's "My documents", and returns the created file's record.

Inputs

  • Authentication (required) — Credential type used for the request: API Key, Basic Auth, OAuth2, or Personal Access Token. The matching credential must be configured.
  • In My Documents (required) — If true, the file is created in the user's "My documents" section. The node looks up that folder's ID automatically. Defaults to false.
  • Parent ID (required) — Numeric ID of the room or folder to create the file in. Shown only when In My Documents is false.
  • Type (required) — Kind of file to create. Document adds .docx, Spreadsheet adds .xlsx, Presentation adds .pptx, and PDF Form adds .pdf. Defaults to Document.
  • Title (required) — File title without an extension. The extension for the chosen Type is appended automatically. Defaults to "File from n8n".

Output shape

One JSON item per input item, containing the created file object returned by the DocSpace API (the response field of the create-file call). It typically includes the file's ID, title, and extension.

The file is created blank, with no content. With Continue On Fail enabled, a failed item returns {error: message} instead of stopping the workflow. The exact fields come from the DocSpace API and aren't defined in the node.

Examples

Example 1: Create a blank spreadsheet in a project room

In My Documents: false; Parent ID: 12345; Type: Spreadsheet; Title: "Q3 Budget". This creates "Q3 Budget.xlsx" in room 12345.

Example 2: Create a personal draft document

In My Documents: true; Type: Document; Title: "Meeting Notes". This creates "Meeting Notes.docx" in the user's My documents.

Links

Discussion