Skip to main content

changeRoomCover

FolderWrapper changeRoomCover(id, CoverRequestDto)

POST /api/2.0/files/rooms/{id}/cover

Change the room cover

Sets the cover picture and the background colour a room is shown with, and returns the whole room afterwards. cover accepts only an identifier listed by GET api/2.0/files/rooms/covers, and color only six hexadecimal digits with no leading number sign, so anything else is rejected as an invalid request. Either field may be sent on its own, an empty cover clears the picture, an empty color restores the default one, and an empty body leaves the room untouched. The cover is what the room shows while it has no uploaded logo: setting a logo with POST api/2.0/files/rooms/{id}/logo hides the cover without erasing it, and deleting that logo brings it back. The caller must be a manager of the room, an archived room is refused with 403, and an unknown or deleted room is answered with 404. Repeating the same request is harmless, and the cover survives archiving and unarchiving.

Parameters​

NameInTypeDescriptionNotes
idpathInteger (int32)The room to change, named by the identifier that GET api/2.0/files/rooms reports for it.[required] [example: 1]
CoverRequestDtobodyCoverRequestDtoThe cover and the colour to apply. Either half may be sent on its own, and an empty object leaves the room as it is.[required]

Responses​

Status codeDescriptionTypeResponse headers
200The room as it is after the cover changeFolderWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read, color is not six hexadecimal digits, cover is not an identifier from the cover gallery, or a third-party identifier refers to a storage account that is not connected--
403The caller may not edit this room, or the room is archived--
404No room with this ID exists, or the id is neither a 32-bit number nor a third-party identifier of a known storage type--
500A third-party identifier carries a storage account number beyond the 32-bit range--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
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
idpathStringThe room to change, named by the identifier that `GET api/2.0/files/rooms` reports for it.[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