Cloudreve API Docs
  1. Share
Cloudreve API Docs
  • Site
    • Ping
      GET
    • Get CAPTCHA
      GET
    • Get site settings
      GET
  • Session
    • Token
      • Password sign-in
      • Finish sign-in with 2FA
      • Refresh Token
      • Sign out
    • OpenID
      • Prepare OpenID sign-in
      • Finish OpenID sign-in
      • Unlink OpenID
    • Passkey
      • Prepare Passkey sign-in
      • Finish Passkey sign-in
    • Prepare login
      GET
  • User
    • Passkey
      • Prepare passkey registration
      • Finish passkey registration
      • Delete passkey
    • Setting
      • List available storage policies
      • List available nodes
      • Get preferences
      • Prepare enabling 2FA
      • Update preference setting
      • Update profile pricture
    • Sign up
      POST
    • Send reset password email
      POST
    • Reset password via temp link
      PATCH
    • Get profile picture
      GET
    • Get user
      GET
    • List user's share links
      GET
    • Get storage capacity
      GET
    • Search user
      GET
    • List credit changes
      GET
    • List payments
      GET
  • Callback
    • Complete OneDrive upload
      GET
    • Complete COS upload
      GET
    • Complete S3 upload
      GET
    • Complete OBS upload
      GET
  • Workflow
    • Remote Download
      • Create remote download
      • Select files to download
      • Cancel task
    • List tasks
    • Get task progress
    • Create archive
    • Extract archive
    • Relocate storage policy
    • Import external files
  • File
    • Permission
      • Set permission
      • Delete permission setting
    • Upload
      • Create upload session
      • Upload file chunk
      • Delete upload session
    • Pin
      • Pin to sidebar
      • Delete a pin
    • Version
      • Set file version
      • Delete file version
    • Direct Link
      • Create direct links
      • Delete direct link
    • List files
    • List file activities
    • Get file info
    • Get thumbnail URL
    • Update file content
    • Create viewer session
    • Create file
    • Rename file
    • Move or copy files
    • Create download URL
    • Restore from trash bin
    • Delete file
    • Force unlock
    • Patch metadata
    • Mount storage policy
    • Update view setting
  • Share
    • Create share link
      PUT
    • Edit share link
      POST
    • Get share link info
      GET
    • List my share links
      GET
    • Delete share link
      DELETE
  • VAS
    • Payment
      • Create a payment
      • Get payment status
    • GiftCode
      • Check gift code
      • Redeem gift code
  • Group
    • List groups
  • WebDAV
    • List accounts
    • Create account
    • Update account
    • Delete account
  1. Share

Edit share link

POST
/share/{id}
Auth: JWT Required
Create a share link to given file. Only file owner or administrator can create share links.

Request

Authorization
Add the parameter
Authorization
to Headers
,whose value is to concatenate the Token after the Bearer.
Example:
Authorization: Bearer ********************
Path Params
id
string 
required
ID of the share link.
Example:
LJ6cM
Body Params application/json
permissions
object (PermissionSetting) 
required
Required in Pro edition. Permission setting of the share link.
user_explicit
object 
optional
Map of explicit permission setting from user ID to boolset.
group_explicit
object 
optional
Map of explicit permission setting from group ID to boolset.
same_group
string 
optional
Permission for users under the same group as the file owner.
other
string 
optional
Permission for users under the different groups as the file owner.
anonymous
string 
optional
Permission for anonymous users.
Example:
AQ==
everyone
string 
optional
Permission for everyone else.
Example:
AQ==
uri
string 
required
URI of the shared file or folder.
share_view
boolean  | null 
optional
Whether view settings within the shared folder is exposed to other user. If uri points to a file, this field is appliable.
expire
integer  | null 
optional
Number of seconds after which the link will be expired. Empty value means permanent link.
Example:
864000
price
integer  | null 
optional
Only in Pro edition. Set the price (in points) to pay for this link.
Example:
20
Example
{
    "permissions": {
        "anonymous": "BQ==",
        "everyone": "AQ=="
    },
    "uri": "cloudreve://my/Inspirations",
    "share_view": true,
    "expire": 604800,
    "price": 20
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/share/LJ6cM' \
--header 'Content-Type: application/json' \
--data-raw '{
    "permissions": {
        "anonymous": "BQ==",
        "everyone": "AQ=="
    },
    "uri": "cloudreve://my/Inspirations",
    "share_view": true,
    "expire": 604800,
    "price": 20
}'

Responses

🟢200Success
application/json
Body
data
string  | null 
optional
URL of the share link.
code
integer 
required
Response code.
0 - Success.
Default:
0
Example:
0
msg
string 
optional
Human readable error message (if any).
error
string  | null 
optional
Internal error message, only visable in debug mode.
correlation_id
string <uuid> | null 
optional
Correlation ID of the request. Only presented on failed reqeust.
Example:
b4351ecc-ee1a-4455-bc94-2c3dbcc58538
Example
{
    "code": 0,
    "data": "http://localhost:5173/s/g2guA/gcqzfaze",
    "msg": ""
}
Modified at 2025-06-17 06:00:21
Previous
Create share link
Next
Get share link info
Built with