Delete Folders

    Deletes a specified folder from the mailbox.

    Caution

    • All messages in the deleted folder will be permanently deleted or moved to Trash based on user settings.
    • If a parent folder is deleted, its child folders are deleted as well.
    • The system folders (whose folderSN is smaller than 100) cannot be deleted.
    • The API request returns success even if the folder to delete does not exist.

    API Type

    Service API

    Request URL

    https://apis.worksmobile.com/r/{API ID}/mail/v2/removeFolder

    HTTP Method

    DELETE(Content-Type: application/x-www-form-urlencoded; charset=UTF-8)

    Request

    Parameter Type Required Description
    folderSN String Y Folder serial number

    Request Example

    https://apis.worksmobile.com/r/{API ID}/mail/v2/removeFolder?folderSN=123
    

    Response

    It returns HTTP status 200 with no response when the API call is successful.

    Error

    It returns an error code and message with HTTP status when the API call fails.

    Property Type Description
    code String Error code
    message String Error message
    HTTP status Error code Description
    400 INVALID_PARAMETER Invalid request parameters
    403 FORBIDDEN System folder cannot be deleted
    500 SYSTEM_ERROR Internal server error
    Error Example
    {
        "code": "INVALID_PARAMETER",
        "message": "Invalid parameter, Please check folderSN",
        "domain": "mail"
    }