• 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

renamefile

Name

renamefile

Auth

yes

Description

Rename a file

Renames (and/or moves) a file identified by fileid or path to either topath (if topath is a foldername without new filename it MUST end with slash - /newpath/) or tofolderid/toname (one or both can be provided).

If the destination file already exists it will be replaced atomically with the source file, in this case the metadata will include deletedfileid with the fileid of the old file at the destination, and the source and destination files revisions will be merged together.

URL

https://api.pcloud.com/renamefile

Required

ParameterDescription
fileidint ID of the renamed file
pathstring Path to the renamed file
topathstring Destination path of renamed file
tofolderidint Id of the folder to which the file is moved
tonamestring Destination filename of the renamed file
Use fileid or path

Output

On success returns renamed file's metadata with deletedfileid if merged file.

Example

{
    "result": 0,
    "metadata": {
        "id": "f1729212",
        "fileid": 1729212,
        "size": 73269,
        "isfolder": false,
        "hash": 10681749967730527559,
        "isshared": false,
        "thumb": true,
        "height": 600,
        "contenttype": "image\/jpeg",
        "icon": "image",
        "created": "Wed, 02 Oct 2013 14:29:11 +0000",
        "width": 900,
        "modified": "Wed, 02 Oct 2013 16:07:40 +0000",
        "ismine": true,
        "name": "My picture.jpg",
        "category": 1,
        "parentfolderid": 0
    }
}

Errors

CodeDescription
1000Log in required.
1004No fileid or path provided.
1037Please provide at least one of 'topath', 'tofolderid' or 'toname'.
2000Log in failed.
2001Invalid file/folder name.
2002A component of parent directory does not exist.
2003Access denied. You do not have permissions to preform this operation.
2005Directory does not exist.
2008User is over quota.
2009File not found.
2010Invalid path.
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