Share file

Share a file or folder by public link, or with a user, group or email address.

POST https://cotlet.dev/api/v1/nextcloud/file/share

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

Parameters: share_file
NameTypeDescription
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.

Request

cURL
curl -X POST https://cotlet.dev/api/v1/nextcloud/file/share \
  -H "Authorization: Bearer $COTLET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"path":"/Clients/Acme/proposal-q4.pdf","share_type":"link","password":"Fj82-mint-ocean","expire_date":"2026-11-15"}'
Python
result = client.call("nextcloud", "share_file", {"path":"/Clients/Acme/proposal-q4.pdf","share_type":"link","password":"Fj82-mint-ocean","expire_date":"2026-11-15"})
Node.js
const result = await cotlet.call('nextcloud', 'share_file', {"path":"/Clients/Acme/proposal-q4.pdf","share_type":"link","password":"Fj82-mint-ocean","expire_date":"2026-11-15"});
CLI
cotlet call nextcloud share_file --data '{"path":"/Clients/Acme/proposal-q4.pdf","share_type":"link","password":"Fj82-mint-ocean","expire_date":"2026-11-15"}'

Example response

JSON

{
  "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"
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.