Skip to content

Share Item

Share publicly file or folder.

Endpoint

http
POST /api/v1/share

Parameters

Body parameters

ParameterTypeRequiredDescription
iduuidyesThe id of the item you want to share
isPasswordboolean-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
typestringyesThe type of the renaming item. Allowed types are folder or file
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
emailsarray-The array of the valid email adresses

Request example

sh
curl --location --request POST 'https://files.ro/api/v1/share' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {token}' \
--data-raw '{
  "id": "{item_id}",
  "isPassword": true,
  "password": "secret_password",
  "type": "folder",
  "permission": "editor",
  "expiration": 1,
  "emails": [
    "jane@doe.com"
  ]
}'

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 item is currently shared."
}
json
{
  "type": "error",
  "message": "The permission field for folder is required."
}
json
{
  "message": "This action is unauthorized."
}