Delete an empty folder

DELETE/api/v1/mailbox/folders/{folder}
Requires amailbox token— it acts as one mailbox holder, not as the organization.

{folder} is the folder's id from GET /folders. Empty it first: move or delete its messages and subfolders. Answers with the folder list that is left.

Errors

Status When
401 No token, or the session expired or was signed out. Sign in again with POST /mailbox-auth/login.
403 The account has a temporary password: until POST /security/password succeeds, every other call answers this with error_code: password_change_required.
409 error_code says why: cannot_delete_special_folder, folder_not_empty or folder_has_subfolders.

Parameters

NameInTypeDescription
folderrequiredpathstring

Request

DELETE/api/v1/mailbox/folders/{folder}
curl -X DELETE 'https://courier.mailyte.com/api/v1/mailbox/folders/01JBT8XQ2M9WYC3K4F6R7S8T9V' \
  -H 'Authorization: Bearer MAILBOX_TOKEN'

Response

Successful Response

  • dataarray<object>
    • idstring

      A stable id for the folder (a hash of its name).

    • namestring

      The folder's full name; use it as folder in other calls.

    • rolestring or nullinbox | sent | drafts | trash | junk | archive | scheduled | null
    • totalinteger

      Messages in the folder.

    • unreadinteger
    • uid_nextinteger
    • uid_validityinteger
200application/json
{
  "type": "success",
  "msg": "Folder deleted",
  "data": [
    {
      "id": "7e33429f656f1e6e9d79b29c3f82c57e",
      "name": "INBOX",
      "role": "inbox",
      "total": 1284,
      "unread": 3,
      "uid_next": 4822,
      "uid_validity": 1712345678
    },
    {
      "id": "ad0b7f0a1fb9a8b5bc8cd2e4c4c6f1a2",
      "name": "Sent",
      "role": "sent",
      "total": 412,
      "unread": 0,
      "uid_next": 413,
      "uid_validity": 1712345679
    },
    {
      "id": "3b9c3ed2a7b3d0c4f1e0a4d9b8f7e6c5",
      "name": "Drafts",
      "role": "drafts",
      "total": 2,
      "unread": 0,
      "uid_next": 31,
      "uid_validity": 1712345680
    }
  ]
}

Returned inside the standard envelope.

Errors

StatusWhen
401No token, or the session expired or was signed out. Sign in again with `POST /mailbox-auth/login`.
403The account has a temporary password: until `POST /security/password` succeeds, every other call answers this with `error_code: password_change_required`.
409`error_code` says why: `cannot_delete_special_folder`, `folder_not_empty` or `folder_has_subfolders`.
422Validation Error

Every status, with what causes it and what to do, is on the error reference.