1. Overview
Nextcloud is a suite of client-server software for creating and using file hosting services. It is functionally similar to Dropbox, Office 365 or Google Drive, but can be self-hosted on a private server.
With the GoInsight Nextcloud node, you can seamlessly integrate file, folder, and user management into your automated workflows. This allows you to perform a wide range of administrative and operational tasks directly within your Nextcloud instance, including:
- File Management: Upload, download, copy, move, delete, and share files.
- Folder Management: Create, list the contents of, copy, move, delete, and share folders.
- User Administration: Create, retrieve, list, update, and delete user accounts.
2. Prerequisites
Before using this node, you need to have a valid Nextcloud account with a running instance. For user management operations such as creating, deleting, or updating users, you will need administrator privileges.
3. Credentials
For a detailed guide on how to obtain and configure your credentials, please refer to our official documentation: Credentials Configuration Guide.
4. Supported Operations
Summary
This node provides comprehensive management for files, folders, and users within your Nextcloud instance. You can perform a full range of operations from creating and deleting resources to managing shares and user accounts.
| Resource | Operation | Description |
|---|---|---|
| File | Upload a File | Upload a file to Nextcloud using WebDAV API with HTTP Basic Authentication (Base64 encoded credentials). Supports uploading files within the same Nextcloud instance using Base64 file content. |
| File | Download a File | Download a file from Nextcloud using WebDAV API with HTTP Basic Authentication (Base64 encoded credentials). Returns file content in Base64 and basic metadata. |
| File | Copy a File | Copy a file in Nextcloud using WebDAV API with HTTP Basic Authentication (Base64 encoded credentials). Supports copying files between different paths within the same Nextcloud instance. |
| File | Move a File | Move a file in Nextcloud using WebDAV API with HTTP Basic Authentication (Base64 encoded credentials). Supports moving files between different paths within the same Nextcloud instance. |
| File | Share a File | Share a single file via Nextcloud OCS Files Sharing API. Supports public link, user, group, or email sharing. Requires shareWith when shareType is user/group/email. |
| File | Delete a File | Delete a file in Nextcloud using WebDAV API with HTTP Basic Authentication (Base64 encoded credentials). Supports deleting files within the same Nextcloud instance. |
| Folder | Create a Folder | Create a folder in Nextcloud using WebDAV MKCOL with HTTP Basic Authentication (Base64 encoded credentials). Ensures path normalization and common error handling. |
| Folder | List a Folder | List files and folders in a Nextcloud folder using WebDAV PROPFIND API with HTTP Basic Authentication (Base64 encoded credentials). Returns detailed information about each item including name, path, type, size, and last modification time. |
| Folder | Copy a Folder | Copy a folder recursively in Nextcloud using WebDAV COPY with Depth=infinity and HTTP Basic Authentication (Base64 encoded credentials). |
| Folder | Move a Folder | Move a folder in Nextcloud using WebDAV API with HTTP Basic Authentication (Base64 encoded credentials). Supports moving folders between different paths within the same Nextcloud instance, including all contents (files and subfolders). |
| Folder | Share a Folder | Share a folder via Nextcloud OCS Files Sharing API. Supports public link, user, group, or email sharing. Requires shareWith when shareType is user/group/email. |
| Folder | Delete a Folder | Delete a folder in Nextcloud using WebDAV API with HTTP Basic Authentication. This action removes the folder and all its contents. |
| User | Create a User | Create a new user in Nextcloud via OCS Provisioning API with HTTP Basic Authentication (Base64 encoded credentials). |
| User | Get a User | Get detailed information for a specific user via Nextcloud OCS API. Requires admin privileges or requesting own info. |
| User | Get many Users | Get a list of users from Nextcloud using OCS API. Supports search filtering, pagination with limit and offset parameters. Requires administrative privileges to list all users. |
| User | Update a User | Update a user attribute (displayname, email, quota, password, enabled) in Nextcloud using OCS Provisioning API. |
| User | Delete a User | Delete a user in Nextcloud using OCS Provisioning API with HTTP Basic Authentication (Base64 encoded credentials). This operation permanently deletes the user and all associated data. Requires administrator permissions. |
Operation Details
Upload a File
Upload a file to Nextcloud using WebDAV API with HTTP Basic Authentication (Base64 encoded credentials). Supports uploading files within the same Nextcloud instance using Base64 file content.
Input Parameters:
- FilePath: Destination file path (e.g., /Documents/file.pdf)
- FileContentBase64: Base64-encoded file content to upload
Options:
- ContentType: MIME type of the file (default: application/octet-stream)
Output:
- Success (bool): Whether the file upload operation was successful
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
Download a File
Download a file from Nextcloud using WebDAV API with HTTP Basic Authentication (Base64 encoded credentials). Returns file content in Base64 and basic metadata.
Input Parameters:
- FilePath: File path to download (e.g., /Documents/file.pdf)
Output:
- Success (bool): Whether the file download operation was successful
- FileName (string): The downloaded file name
- FileSize (number): File size in bytes (if available)
- ContentType (string): MIME type from response headers (if available)
- FileContent (string): File content encoded in Base64
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
Copy a File
Copy a file in Nextcloud using WebDAV API with HTTP Basic Authentication (Base64 encoded credentials). Supports copying files between different paths within the same Nextcloud instance.
Input Parameters:
- SourcePath: Source file path (e.g., /Documents/file.pdf)
- DestinationPath: Destination file path (e.g., /Backup/file.pdf)
Output:
- Success (bool): Whether the file copy operation was successful
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
Move a File
Move a file in Nextcloud using WebDAV API with HTTP Basic Authentication (Base64 encoded credentials). Supports moving files between different paths within the same Nextcloud instance.
Input Parameters:
- SourcePath: Source file path (e.g., /Documents/file.pdf)
- DestinationPath: Destination file path (e.g., /Archive/file.pdf)
Output:
- Success (bool): Whether the file move operation was successful
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
Share a File
Share a single file via Nextcloud OCS Files Sharing API. Supports public link, user, group, or email sharing. Requires shareWith when shareType is user/group/email.
Options:
- Path: File path to share (e.g., /Documents/file.pdf)
- ShareType: Share target type: 0=user, 1=group, 3=public link, 6=email
- Permissions: Permission bitmask (e.g., 1=read, 15=read/update/create/delete)
- ShareWith: Target account/identifier. Required when ShareType is 0, 1, or 6.
- SharePassword: Optional share password (recommended for public links)
- ExpireDate: Optional expiration date (YYYY-MM-DD)
Output:
- Success (bool): Whether the share operation was successful
- ShareUrl (string): Generated share URL
- ShareId (string): Share identifier
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
Delete a File
Delete a file in Nextcloud using WebDAV API with HTTP Basic Authentication (Base64 encoded credentials). Supports deleting files within the same Nextcloud instance.
Input Parameters:
- FilePath: File path to delete (e.g., /Documents/file.pdf)
Output:
- Success (bool): Whether the file delete operation was successful
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
Create a Folder
Create a folder in Nextcloud using WebDAV MKCOL with HTTP Basic Authentication (Base64 encoded credentials). Ensures path normalization and common error handling.
Input Parameters:
- FolderPath: Folder path to create (e.g., /Documents/NewFolder)
Output:
- Success (bool): Whether the folder was created successfully
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
List a Folder
List files and folders in a Nextcloud folder using WebDAV PROPFIND API with HTTP Basic Authentication (Base64 encoded credentials). Returns detailed information about each item including name, path, type, size, and last modification time.
Input Parameters:
- FolderPath: Folder path to list (e.g., /Documents)
Options:
- Depth: Depth of listing: 1 for current folder only, 2 for one level deep
Output:
- Success (bool): Whether the folder listing was successful
- Items (object-array): List of items in the folder with Name, Path, Type, Size, and LastModified
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
Copy a Folder
Copy a folder recursively in Nextcloud using WebDAV COPY with Depth=infinity and HTTP Basic Authentication (Base64 encoded credentials).
Input Parameters:
- SourceFolderPath: Source folder path (e.g., /Projects/ProjectA)
- DestinationFolderPath: Destination folder path (e.g., /Backup/ProjectA)
Output:
- Success (bool): Whether the folder copy operation was successful
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
Move a Folder
Move a folder in Nextcloud using WebDAV API with HTTP Basic Authentication (Base64 encoded credentials). Supports moving folders between different paths within the same Nextcloud instance, including all contents (files and subfolders).
Input Parameters:
- SourceFolderPath: Source folder path (e.g., /Projects/ProjectA)
- DestinationFolderPath: Destination folder path (e.g., /Archive/ProjectA)
Output:
- Success (bool): Whether the folder move operation was successful
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
Share a Folder
Share a folder via Nextcloud OCS Files Sharing API. Supports public link, user, group, or email sharing. Requires shareWith when shareType is user/group/email.
Options:
- Path: Folder path to share (e.g., /Documents/ProjectA)
- ShareType: Share target type: 0=user, 1=group, 3=public link, 6=email
- Permissions: Permission bitmask (e.g., 1=read, 15=read/update/create/delete)
- ShareWith: Target account/identifier. Required when ShareType is 0, 1, or 6.
- SharePassword: Optional share password (recommended for public links)
- ExpireDate: Optional expiration date (YYYY-MM-DD)
Output:
- Success (bool): Whether the share operation was successful
- ShareUrl (string): Generated share URL
- ShareId (string): Share identifier
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
Delete a Folder
Delete a folder in Nextcloud using WebDAV API with HTTP Basic Authentication. This action removes the folder and all its contents.
Input Parameters:
- FolderPath: Target folder path (e.g., /Documents/OldFolder)
Output:
- Success (bool): Whether the folder delete operation was successful
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
Create a User
Create a new user in Nextcloud via OCS Provisioning API with HTTP Basic Authentication (Base64 encoded credentials).
Input Parameters:
- NewUserId: Unique user ID to create (no spaces).
- NewUserPassword: Initial password for the new user.
Options:
- DisplayName: Display name for the user (optional).
- Email: Email address for the user (optional).
- Groups: Comma-separated group list (e.g., groupA,groupB).
- Quota: Storage quota (e.g., 10 GB or unlimited).
- Language: Language code for the user (e.g., en, zh_CN).
Output:
- Success (bool): Whether the user creation was successful
- UserId (string): Created user ID
- Groups (string-array): Groups assigned to the user
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
Get a User
Get detailed information for a specific user via Nextcloud OCS API. Requires admin privileges or requesting own info.
Input Parameters:
- UserId: The ID of the user to retrieve
Output:
- Success (bool): Whether the operation was successful
- UserData (object): User information dictionary
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
Get many Users
Get a list of users from Nextcloud using OCS API. Supports search filtering, pagination with limit and offset parameters. Requires administrative privileges to list all users.
Options:
- Search: Optional search keyword to filter users by username, display name, or email
- Limit: Optional limit on the number of users to return. 0 means no limit
- Offset: Optional offset for pagination. Default 0
Output:
- Success (bool): Whether the operation was successful
- Users (string-array): List of user IDs
- TotalCount (number): Total number of users matching the query
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
Update a User
Update a user attribute (displayname, email, quota, password, enabled) in Nextcloud using OCS Provisioning API.
Input Parameters:
- TargetUserId: The ID of the user to update
- Key: The attribute to update
- Value: The new value for the attribute
Output:
- Success (bool): Whether the update operation was successful
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
Delete a User
Delete a user in Nextcloud using OCS Provisioning API with HTTP Basic Authentication (Base64 encoded credentials). This operation permanently deletes the user and all associated data. Requires administrator permissions.
Input Parameters:
- UserId: User ID to delete (e.g., olduser)
Output:
- Success (bool): Whether the user deletion was successful
- UserId (string): Deleted user ID
- StatusCode (number): HTTP status code
- ErrorMessage (string): Error message when exception occurs
5. Example Usage
This section will guide you through creating a simple workflow to create a new folder in your Nextcloud account.
The workflow will consist of three nodes: Start -> Nextcloud: Create a Folder -> Answer.
- Add the Nextcloud Node
- In the workflow canvas, click the + button to add a new node.
- Select the "Tools" tab in the pop-up panel.
- Find and select "Nextcloud" from the list of tools.
- In the list of supported operations for Nextcloud, click on "Create a Folder" to add the node to your canvas.
- Configure the Node
- Click on the newly added "Create a Folder" node to open its configuration panel on the right.
- Credentials: Find the credentials field at the top of the panel. Click the dropdown menu and select your pre-configured Nextcloud credential.
- Parameters: Fill in the required input parameters.
- FolderPath: Enter the full path for the new folder you want to create. This path should start from the root of your Nextcloud files. For example, to create a folder named "Quarterly Reports" inside a "Documents" folder, you would enter /Documents/Quarterly Reports.
- Run and Verify
- Once all required parameters are correctly filled, any error indicators on the workflow canvas will disappear.
- Click the "Run" button in the top-right corner of the canvas to execute the workflow.
- After a successful execution, you can click the log icon in the top-right corner to view the detailed inputs and outputs of the node, confirming that the operation was successful.
After completing these steps, your workflow is fully configured. When you run it, a new folder will be created in your Nextcloud instance at the specified path.
6. FAQs
Q: Why am I getting a 401 Unauthorized error?
A: This error typically indicates an issue with your credentials. Please check the following:
- Ensure your Nextcloud URL, username, and password (or app password/token) are correct in the credential configuration.
- If you are using an app password, make sure it has not been revoked in your Nextcloud security settings.
- Verify that your Nextcloud instance is accessible from the GoInsight environment.
Q: My "Create User" action is failing with a 403 Forbidden error. Why?
A: Operations that manage users, such as creating, deleting, or updating them, require administrator privileges in Nextcloud. Ensure that the user account associated with your credentials is a member of the 'admin' group in your Nextcloud instance.
Q: What is the correct format for file and folder paths?
A: All paths must be absolute, starting from the root of your user's file directory. They must begin with a forward slash (/). For example, /Documents/Reports/Q1_Report.pdf is a valid file path.
7. Official Documentation
For more in-depth information about the Nextcloud API, please refer to the official developer documentation:
Leave a Reply.