Skip to Content
Fluxmail

DELETE /api/v1/accounts/{accountId}/folders/{folderId}

Delete a folder that has no messages and no subfolders. Move or trash its mail, and delete its subfolders, first. In Gmail, where the folder is a label, remove the label from its messages. System folders such as Inbox, Sent and Trash can't be deleted, and neither can a folder the account settings use as one.

Delete a folder that has no messages and no subfolders. Move or trash its mail, and delete its subfolders, first. In Gmail, where the folder is a label, remove the label from its messages. System folders such as Inbox, Sent and Trash can't be deleted, and neither can a folder the account settings use as one.

Authentication

Pass a Fluxmail member session or API key as a bearer token. API keys apply their mailbox scope and permissions to the request.

Request

curl 'http://localhost:8977/api/v1/accounts/acct_123/folders/Receipts' \
  -X DELETE \
  -H "Authorization: Bearer $FLUXMAIL_API_KEY"

Parameters

NameLocationRequiredTypeDetails
accountIdpathYesstringMinimum length: 1.
folderIdpathYesstringFolder ID from the folder list, or the folder name. URL-encode it, since folder IDs can contain a slash. Minimum length: 1.

Responses

StatusDescriptionContent type
200The deleted folderapplication/json
400Invalid requestapplication/json
401Authentication requiredapplication/json
403Permission or plan deniedapplication/json
404Resource not foundapplication/json
409Request conflictapplication/json
422Unsupported capabilityapplication/json
429Provider rate limitapplication/json
500Internal errorapplication/json
503Provider unavailableapplication/json

200 response

{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "deleted": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "name"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "deleted"
      ],
      "additionalProperties": false
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "data"
  ],
  "additionalProperties": false
}

Last updated