Skip to main content

renameFolder

FolderWrapper renameFolder(folderId, CreateFolderRequest)

PUT /api/2.0/files/folder/{folderId}

Rename a folder

Gives a folder a new title and answers with the folder as it now stands. The title is trimmed, may not be blank and is refused when it is longer than the limit the schema prints; a title that matches the current one leaves the folder untouched, and titles need not be unique among the neighbours. The caller needs the right to rename the folder, which the room manager, a content creator acting on a folder of their own and the owner of a personal section have, while a guest is refused with 403 whatever their access; a folder in the Trash section or in an archived room cannot be renamed either, and a folder that does not exist is answered as not found. A room may be renamed here as well, in which case the caller needs the right to edit the room, and PUT api/2.0/files/rooms/{id} is the operation that changes its other settings. The call is mutating and idempotent; on a folder stored in a connected third-party account the identifier of the folder may change with the title.

Parameters​

NameInTypeDescriptionNotes
folderIdpathInteger (int32)The folder the request is addressed to: when a folder is created it is the parent that receives the new folder, and when a folder is renamed it is the folder that gets the new title.[required] [example: 1]
CreateFolderRequestbodyCreateFolderRequestThe title carried by the request body.[required]

Responses​

Status codeDescriptionTypeResponse headers
200The folder with its new titleFolderWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read or has no title, or the title is empty, blank or longer than 165 characters--
403The caller may not rename this folder, or the folder lies in Trash or in the archive--
404The folder does not exist--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

FolderWrapper

Third-party storage​

For a file or folder in a connected third-party storage the identifier is a string such as sbox-42, and the call differs in these parts only:

NameInTypeDescriptionNotes
folderIdpathStringThe folder the request is addressed to: when a folder is created it is the parent that receives the new folder, and when a folder is renamed it is the folder that gets the new title.[required] [example: sbox-42]

Return type: ThirdPartyFolderWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json