Skip to content

Update Sharing

Update publicly shared file or folder.

Endpoint

http
PATCH /api/v1/share/{token}

Parameters

Path parameters

ParameterTypeRequiredDescription
tokenstringyes-

Body parameters

ParameterTypeRequiredDescription
protectedboolean-Determine if the folder would be publicly shared or privately secured with the password
passwordstringrequired when ispassword:yesThe password which protect the content stored in the folder
permissionstringrequired when is folderThe edit permissions for the folder. Allowed permission types are editor or visitor.
expirationinteger-The time in hours the link expire automatically

Request example

sh
curl --location --request PATCH 'https://files.ro/api/v1/share/{token}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {token}' \
--data-raw '{
  "protected": true,
  "password": "test",
  "permission": "editor",
  "expiration": 1
}'

Response

json
{
  "data": {
    "id": "share_123",
    "type": "shared",
    "attributes": {
      "permission": "editor",
      "protected": false,
      "item_id": "item_123",
      "expire_in": 24,
      "token": "share_token",
      "link": "https://files.ro/share/share_token",
      "type": "folder"
    }
  }
}
json
{
  "type": "error",
  "message": "The permission field for folder is required."
}
json
{
  "message": "This action is unauthorized."
}