Share file
Share a file or folder by public link, or with a user, group or email address.
MCP tool nextcloud_write → share_file
write Confirm
Creates a share for one file or folder. For a public link you can set a password, an expiry date (YYYY-MM-DD) and a note; permissions default to read only. For a user, group or email address, set share_with. The reply contains the link or the share ID. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| path string required | string | Path inside your files, starting with a slash, e.g. '/Clients/Acme/proposal.pdf'. |
| share_type enum required | enum | link, user, group or email. |
| share_with string | string | User name, group name or email address. Required unless share_type is link. |
| permissions enum | enum | read or edit. Default: read. |
| password string | string | Password for a public link. |
| expire_date date | date | Last day of the share, YYYY-MM-DD. |
| note string | string | Note shown to the recipient. |
tools/call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "nextcloud_write",
"arguments": {
"operation": "share_file",
"arguments": {
"path": "/Clients/Acme/proposal-q4.pdf",
"share_type": "link",
"password": "Fj82-mint-ocean",
"expire_date": "2026-11-15"
}
}
}
} Example response
{
"content": [
{
"type": "text",
"text": "{ ... same JSON as structuredContent ... }"
}
],
"structuredContent": {
"share_id": "460",
"path": "/Clients/Acme/proposal-q4.pdf",
"type": "link",
"url": "https://cloud.example.com/s/Kp3xTq9WmB2Rz7a",
"permissions": "read",
"password_protected": true,
"expires": "2026-11-15"
},
"isError": false
}