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
| 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. |
Request
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"}' result = client.call("nextcloud", "share_file", {"path":"/Clients/Acme/proposal-q4.pdf","share_type":"link","password":"Fj82-mint-ocean","expire_date":"2026-11-15"}) 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"}); 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
{
"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"
}