• General
  • My Apps
  • SDKs
  • Protocols
  • Structures
  • Methods
  • Errors
Log in Register Log out
  • General

  • My Apps

  • SDKs
    • C
    • Java
    • Javascript
    • Php
    • Swift

  • Protocols
    • HTTP JSON Protocol
      • Authentication
      • Single Connection
      • Uploading Files
    • Binary Protocol
      • Sending Binary Request
      • Sending Files
      • Receiving Binary Response
      • Receiving Files Data

  • Structures
    • Datetime
    • Event
    • File Descriptors
    • Filenames
    • Metadata
    • Share
    • Tree

  • Methods
    • Intro
      • Global Parameters
      • Authentication
    • General
      • getdigest
      • userinfo
      • supportedlanguages
      • setlanguage
      • feedback
      • currentserver
      • diff
      • getfilehistory
      • getip
      • getapiserver
    • Folder
      • createfolder
      • createfolderifnotexists
      • listfolder
      • renamefolder
      • deletefolder
      • deletefolderrecursive
      • copyfolder
    • File
      • uploadfile
      • uploadprogress
      • downloadfile
      • downloadfileasync
      • copyfile
      • checksumfile
      • deletefile
      • renamefile
      • stat
    • Auth
      • sendverificationemail
      • verifyemail
      • changepassword
      • lostpassword
      • resetpassword
      • register
      • invite
      • userinvites
      • logout
      • listtokens
      • deletetoken
      • sendchangemail
      • changemail
      • senddeactivatemail
      • deactivateuser
    • Streaming
      • getfilelink
      • getvideolink
      • getvideolinks
      • getaudiolink
      • gethlslink
      • gettextfile
    • Archiving
      • getzip
      • getziplink
      • savezip
      • extractarchive
      • extractarchiveprogress
      • savezipprogress
    • Sharing
      • sharefolder
      • listshares
      • sharerequestinfo
      • cancelsharerequest
      • acceptshare
      • declineshare
      • removeshare
      • changeshare
    • Public Links
      • getfilepublink
      • getfolderpublink
      • gettreepublink
      • showpublink
      • getpublinkdownload
      • copypubfile
      • listpublinks
      • listplshort
      • deletepublink
      • changepublink
      • getpubthumb
      • getpubthumblink
      • getpubthumbslinks
      • savepubthumb
      • getpubzip
      • getpubziplink
      • savepubzip
      • getpubvideolinks
      • getpubaudiolink
      • getpubtextfile
      • getcollectionpublink
    • Thumbnails
      • getthumblink
      • getthumbslinks
      • getthumb
      • savethumb
    • Upload Links
      • createuploadlink
      • listuploadlinks
      • deleteuploadlink
      • changeuploadlink
      • showuploadlink
      • uploadtolink
      • uploadlinkprogress
      • copytolink
    • Revisions
      • listrevisions
      • revertrevision
    • Fileops
      • file_open
      • file_write
      • file_pwrite
      • file_read
      • file_pread
      • file_pread_ifmod
      • file_checksum
      • file_size
      • file_truncate
      • file_seek
      • file_close
      • file_lock
    • Newsletter
      • newsletter_subscribe
      • newsletter_check
      • newsletter_verifyemail
      • newsletter_unsubscribe
      • newsletter_unsibscribemail
    • Trash
      • trash_list
      • trash_restorepath
      • trash_restore
      • trash_clear
    • Collection
      • collection_list
      • collection_details
      • collection_create
      • collection_rename
      • collection_delete
      • collection_linkfiles
      • collection_unlinkfiles
      • collection_move
    • OAuth 2.0
      • authorize
      • oauth2_token
    • Transfer
      • uploadtransfer
      • uploadtransferprogress

  • Errors

sharefolder

Name

sharefolder

Auth

yes

Description

Shares a folder with another user.

Share may be subject to confirmation from the other user. The folder to be shared is identified by folderid or path.

Optional share name can be provided, if it is not, the folder name is used as sharename. Implementations are advised to give opportunity to the sharing user to select the share name, which should be pre-filled with the folder name.

The required parameter mail holds the email address of the user with whom you are sharing the folder.

The required parameter permissions sets the permissions for the folder.

Zero for read-only or any combination (sum/or) of

FlagDescription
1Create permission
2Modify permission
4Delete permission
Optional parameter message allows adding a message to pass to the receiving user.

Folder sharing is a complicated operation and the following errors are likely to be returned:
CodeDescription
2014the user's address is not verified. Implementations are advised upon user confirmation to call sendverificationemail and to ask the user to check his/her email.
2015root folder cannot be shared, this check SHOULD also be performed on the client.
2016one can only share folders with ismine set to true, implementations SHOULD check this locally too.
2017user does not accept requests from you or from anybody, implementations can not know if this is going to happen, but are expected to act appropriately on this error.

URL

https://api.pcloud.com/sharefolder

Required

ParameterDescription
folderidint folder id of the shared folder
pathstring path to the shared folder
mailstring mail of the user with whom you are sharing the folder
permissionsint bitwise combination of permission flags
Use path or folderid

Optional

ParameterDescription
namestring name of the share. Default - the folder name.
messagestring message to pass to the receiving user.

Example

{
    result: 0
}

Errors

CodeDescription
1000Log in required.
1002No full path or folderid provided.
1023Please provide 'mail' to share folder with.
1024Please provide 'permissions' for the share.
2000Log in failed.
2001Invalid file/folder name.
2005Directory does not exist.
2014Please verify your email address to preform this action.
2015Can not share root folder.
2016You can only share your own folders.
2017User does not accept shares.
2018Invalid 'mail' provided.
2019Share request already exists.
2020You can't share a folder with yourself.
2024User already has access to this folder or subfolder of this folder.
4000Too many login tries from this IP address.
5000Internal error. Try again later.
2014 © pCloud. Terms and Conditions. Privacy Policy. Intellectual Property.
© pCloud. Terms and Conditions. Privacy Policy. Intellectual Property.
Reset Password
Check your e-mail for further instructions.
Reset