Reference · Tools

Nextcloud

Manage files, folders, and users on a self-hosted Nextcloud instance via WebDAV and OCS APIs.

Action (binary) Data & Storage v1 Binary data

The Nextcloud node manages files, folders and users on a self-hosted Nextcloud instance through its WebDAV and OCS APIs. A typical build is archiving generated documents into a structured folder tree that colleagues already have access to.

Node type
Action (binary)
Parameters
33
Outputs
Output, Error
Credentials
Nextcloud API

Nextcloud

Manage files, folders, and users on Nextcloud

Overview

Provides file, folder and user management for self-hosted Nextcloud instances across three resources. File covers copy, delete, download (binary), move, share and upload (binary or text). Folder covers copy, create, delete, list, move and share. User covers create, delete, get, get many and update.

Download writes the file to a binary property on the output item; upload reads binary data from an upstream item or accepts text content directly. File and folder work goes over WebDAV; sharing and user administration go over the OCS REST API. The node authenticates with HTTP Basic Auth.

Category: Data & Storage
Tool Name: nextcloud
Version: 1

Appearance: Icon: si-nextcloud | Color: #0082C9

Node Type

Action (Binary) — handles file/binary data operations

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires Nextcloud API credentials. See the Credentials Guide for setup instructions.

Resources

ResourceValue
Filefile
Folderfolder
Useruser

Operations

The available operations depend on the selected resource — file operations first, then folder, then user.

OperationValueDescription
CopycopyCopy a file
DeletedeleteDelete a file
DownloaddownloadDownload a file
MovemoveMove a file
ShareshareShare a file
UploaduploadUpload a file
CopycopyCopy a folder
CreatecreateCreate a folder
DeletedeleteDelete a folder
ListlistList folder contents
MovemoveMove a folder
ShareshareShare a folder
CreatecreateCreate a new user
DeletedeleteDelete a user
GetgetGet a user
Get ManygetAllGet many users
UpdateupdateUpdate a user

Parameters

File: Copy

ParameterTypeRequiredDefaultDescription
From PathstringYesThe path of the file or folder to copy. Must start with ”/”. Supports expressions.
To PathstringYesThe destination path. Must start with ”/”. Supports expressions.

File: Delete

ParameterTypeRequiredDefaultDescription
PathstringYesThe path to delete. Must start with ”/”. Supports expressions.

File: Download

ParameterTypeRequiredDefaultDescription
File PathstringYesThe full file path to download. Must start with ”/”. Supports expressions.
Binary PropertystringYesdataName of the output binary property to store the file in. Names are case-sensitive — see the upstream node’s Binary Data panel for the exact names to use.

File: Move

ParameterTypeRequiredDefaultDescription
From PathstringYesThe path of the file or folder to move. Must start with ”/”. Supports expressions.
To PathstringYesThe new path. Must start with ”/”. Supports expressions.

File: Share

ParameterTypeRequiredDefaultDescription
PathstringYesThe file or folder path to share. Must start with ”/”. Supports expressions.
Share TypeoptionsNo0The type of share.
Options: 0 (User), 1 (Group), 3 (Public Link), 4 (Email), 7 (Circle)
UserstringNoThe user to share with. (shown when Share Type is 0)
Group IDstringNoThe group ID to share with. (shown when Share Type is 1)
Email (shareEmail)stringNoThe email address to share with. (shown when Share Type is 4)
Circle IDstringNoThe circle ID to share with. (shown when Share Type is 7)
Options (shareOptions)collectionNo{}Extra share settings.
— PasswordstringNoPassword for public link shares. (shown when Share Type is 3)
— PermissionsoptionsNo1The share permissions to set.
Options: 1 (Read), 2 (Update), 4 (Create), 8 (Delete), 31 (All)

File: Upload

ParameterTypeRequiredDefaultDescription
File PathstringYesThe destination file path. Parent folder must exist. Existing files are overwritten. Must start with ”/”. Supports expressions.
Binary FilebooleanYesfalseWhether to upload binary data from an input binary property.
File ContentstringNoThe text content of the file to upload. Supports expressions. (shown when Binary File is false)
Binary PropertystringYesdataName of the input binary property containing the file to upload. Names are case-sensitive — see the upstream node’s Binary Data panel for the exact names to use. (shown when Binary File is true)

Folder: Copy

ParameterTypeRequiredDefaultDescription
From PathstringYesThe path of the file or folder to copy. Must start with ”/”. Supports expressions.
To PathstringYesThe destination path. Must start with ”/”. Supports expressions.

Folder: Create

ParameterTypeRequiredDefaultDescription
FolderstringYesThe folder to create. Parent folder must exist. Must start with ”/”. Supports expressions.

Folder: Delete

ParameterTypeRequiredDefaultDescription
PathstringYesThe path to delete. Must start with ”/”. Supports expressions.

Folder: List

ParameterTypeRequiredDefaultDescription
Folder PathstringYesThe folder path to list. Must start with ”/”. Supports expressions.

Folder: Move

ParameterTypeRequiredDefaultDescription
From PathstringYesThe path of the file or folder to move. Must start with ”/”. Supports expressions.
To PathstringYesThe new path. Must start with ”/”. Supports expressions.

Folder: Share

ParameterTypeRequiredDefaultDescription
PathstringYesThe file or folder path to share. Must start with ”/”. Supports expressions.
Share TypeoptionsNo0The type of share.
Options: 0 (User), 1 (Group), 3 (Public Link), 4 (Email), 7 (Circle)
UserstringNoThe user to share with. (shown when Share Type is 0)
Group IDstringNoThe group ID to share with. (shown when Share Type is 1)
Email (shareEmail)stringNoThe email address to share with. (shown when Share Type is 4)
Circle IDstringNoThe circle ID to share with. (shown when Share Type is 7)
Options (shareOptions)collectionNo{}Extra share settings.
— PasswordstringNoPassword for public link shares. (shown when Share Type is 3)
— PermissionsoptionsNo1The share permissions to set.
Options: 1 (Read), 2 (Update), 4 (Create), 8 (Delete), 31 (All)

User: Create

ParameterTypeRequiredDefaultDescription
UsernamestringYesUsername for the new user. Supports expressions.
Email (email)stringYesEmail address for the new user. Supports expressions.
Additional FieldscollectionNo{}Optional profile values for the new user.
— Display NamestringNoThe display name of the new user.

User: Delete

ParameterTypeRequiredDefaultDescription
UsernamestringYesThe username. Supports expressions.

User: Get

ParameterTypeRequiredDefaultDescription
UsernamestringYesThe username. Supports expressions.

User: Get Many

ParameterTypeRequiredDefaultDescription
Return AllbooleanNofalseWhether to return all users or limit the results.
LimitnumberNo50Maximum number of users to return. (shown when Return All is false)
Options (userGetAllOptions)collectionNo{}Extra search and paging options.
— SearchstringNoSearch filter string.
— OffsetnumberNo0Pagination offset.

User: Update

ParameterTypeRequiredDefaultDescription
UsernamestringYesThe username. Supports expressions.
Update FieldsfixedCollectionNo{}The single attribute to change.
— KeyoptionsNoemailThe attribute to update.
Options: address, displayname, email, password, twitter, website
— ValuestringNoThe new value for the attribute. Supports expressions.

All Operations

ParameterTypeRequiredDefaultDescription
Max ConcurrencynumberNo10Maximum number of items to process concurrently.

Output Data

Every operation produces exactly one output item — nothing fans out. Results are merged into the input item’s JSON, so the incoming fields stay available, and binary data on the input item is forwarded.

OperationOutput
file / downloadJSON unchanged; the file is written to the binary property you named, alongside any binary already on the item.
file / uploadsuccess: true and path.
file / copy, move and folder / copy, movesuccess: true, fromPath, toPath.
file / delete, folder / deletesuccess: true and deletedPath.
file / share, folder / shareThe share record Nextcloud returned, flattened onto the item.
folder / createsuccess: true and path.
folder / listAn entries array — one object per child of the folder.
user / createThe new user’s returned fields plus userId.
user / getThe user’s profile fields.
user / getAllA users array of { id } objects.
user / delete, updatestatus, statuscode and message from the Nextcloud response.

A folder listing looks like this:

{
  "entries": [
    {
      "path": "/invoices/2019/invoice_1.pdf",
      "lastModified": "Tue, 04 Jun 2024 10:12:31 GMT",
      "contentLength": "48211",
      "contentType": "application/pdf",
      "type": "file",
      "eTag": "5f2a1c9b8d7e6"
    },
    {
      "path": "/invoices/2019/archive/",
      "lastModified": "Mon, 03 Jun 2024 08:00:00 GMT",
      "type": "folder",
      "eTag": "a1b2c3d4e5f60"
    }
  ]
}

The folder itself is excluded from the listing, and only one level down is returned. Because both entries and users arrive as arrays on a single item, use a Split Out node on entries or users to process each row separately.

Usage Examples

  • Download a file from Nextcloud
  • Upload a binary file to Nextcloud
  • Upload text content to Nextcloud
  • List all files in a Nextcloud folder
  • Create a folder on Nextcloud
  • Share a file via public link
  • Create a new Nextcloud user
  • Get all Nextcloud users
  • Move a file on Nextcloud

Example Configuration

Upload text content as a file:

{
  "type": "nextcloud",
  "parameters": {
    "resource": "file",
    "operation": "upload",
    "path": "/documents/example.txt",
    "binaryDataUpload": false,
    "fileContent": "{{ $json.body }}"
  }
}

Upload binary data coming from an upstream node:

{
  "type": "nextcloud",
  "parameters": {
    "resource": "file",
    "operation": "upload",
    "path": "/images/{{ $json.fileName }}",
    "binaryDataUpload": true,
    "binaryPropertyName": "data"
  }
}

Download a file into a named binary property:

{
  "type": "nextcloud",
  "parameters": {
    "resource": "file",
    "operation": "download",
    "path": "/documents/report.pdf",
    "binaryPropertyName": "downloadedFile"
  }
}

Copy a file:

{
  "type": "nextcloud",
  "parameters": {
    "resource": "file",
    "operation": "copy",
    "path": "/documents/original.txt",
    "toPath": "/backup/original_copy.txt"
  }
}

Share a file with a single user, read-only:

{
  "type": "nextcloud",
  "parameters": {
    "resource": "file",
    "operation": "share",
    "path": "/documents/shared_doc.pdf",
    "shareType": 0,
    "shareUser": "jsmith",
    "shareOptions": {
      "permissions": 1
    }
  }
}

Create a password-protected public link:

{
  "type": "nextcloud",
  "parameters": {
    "resource": "file",
    "operation": "share",
    "path": "/public/presentation.pptx",
    "shareType": 3,
    "shareOptions": {
      "password": "linkpass"
    }
  }
}

Create a folder:

{
  "type": "nextcloud",
  "parameters": {
    "resource": "folder",
    "operation": "create",
    "path": "/projects/new_project"
  }
}

List a folder’s contents:

{
  "type": "nextcloud",
  "parameters": {
    "resource": "folder",
    "operation": "list",
    "path": "/documents"
  }
}

Share a folder with a group, full permissions:

{
  "type": "nextcloud",
  "parameters": {
    "resource": "folder",
    "operation": "share",
    "path": "/team/shared_folder",
    "shareType": 1,
    "groupId": "team_group",
    "shareOptions": {
      "permissions": 31
    }
  }
}

Create a user:

{
  "type": "nextcloud",
  "parameters": {
    "resource": "user",
    "operation": "create",
    "userId": "{{ $json.username }}",
    "email": "{{ $json.email }}",
    "additionalFields": {
      "displayName": "{{ $json.fullName }}"
    }
  }
}

Search users with paging:

{
  "type": "nextcloud",
  "parameters": {
    "resource": "user",
    "operation": "getAll",
    "returnAll": false,
    "limit": 50,
    "userGetAllOptions": {
      "search": "john",
      "offset": 0
    }
  }
}

Change a user’s email address:

{
  "type": "nextcloud",
  "parameters": {
    "resource": "user",
    "operation": "update",
    "userId": "existinguser",
    "updateFields": {
      "field": {
        "key": "email",
        "value": "newemail@example.com"
      }
    }
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Manage files, folders, and users on a self-hosted Nextcloud instance via WebDAV and OCS APIs.

  • Every path is absolute and starts with /. Paths are relative to the root of the account the credential belongs to.
  • Parent folders are not created for you. Upload and folder Create both fail if the containing folder does not exist yet — chain a folder Create per level when building a new tree.
  • Upload overwrites silently. An existing file at the destination path is replaced.
  • Transfers are capped at 512 MB in each direction; larger files are rejected before any data is buffered.
  • The recipient field follows Share Type. User shares need User, group shares need Group ID, email shares need Email, circle shares need Circle ID, and public links need none of them. The Password option only applies to public links.
  • Update changes one attribute at a time. Update Fields holds a single key/value pair, so changing an email and a display name takes two runs of the node.
  • HTTPS is required for anything other than a loopback address, because Basic Auth credentials would otherwise travel in cleartext.
  • Folder List returns one level. The folder itself is omitted and subfolders are listed but not descended into.

Frequently asked questions

What format do paths take?

Every path is absolute and starts with `/`, relative to the root of the account the credential belongs to — not relative to any working directory.

Why does my upload fail into a new folder?

Parent folders are not created for you. Upload and folder Create both fail if the containing folder does not exist, so chain a folder Create per level when building a new tree.

What happens if a file already exists at the destination?

Upload overwrites silently — the existing file at that path is replaced with no warning, so check first if that matters.

Which credential does it need?

A Nextcloud API credential for the instance and account whose root the paths are relative to.

Build with the Nextcloud node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Nextcloud API credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.