Delete folder
curl --request DELETE \
--url https://console.mermail.app/api/v1/mailboxes/{mailboxId}/folders/{folderId} \
--header 'x-api-key: <api-key>'import requests
url = "https://console.mermail.app/api/v1/mailboxes/{mailboxId}/folders/{folderId}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://console.mermail.app/api/v1/mailboxes/{mailboxId}/folders/{folderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://console.mermail.app/api/v1/mailboxes/{mailboxId}/folders/{folderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://console.mermail.app/api/v1/mailboxes/{mailboxId}/folders/{folderId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://console.mermail.app/api/v1/mailboxes/{mailboxId}/folders/{folderId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.mermail.app/api/v1/mailboxes/{mailboxId}/folders/{folderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{}{
"error": "Unauthorized"
}{
"error": "Invalid request"
}{
"error": "Forbidden"
}{
"error": "Too many requests"
}Emails
Delete folder
Plans: Free · Developer · Enterprise
Deletes a custom folder. Returns 204 on success, or 400 if the folder is missing or cannot be deleted (e.g. system folders).
API credits: 2 (write).
DELETE
https://console.mermail.app
/
api
/
v1
/
mailboxes
/
{mailboxId}
/
folders
/
{folderId}
Delete folder
curl --request DELETE \
--url https://console.mermail.app/api/v1/mailboxes/{mailboxId}/folders/{folderId} \
--header 'x-api-key: <api-key>'import requests
url = "https://console.mermail.app/api/v1/mailboxes/{mailboxId}/folders/{folderId}"
headers = {"x-api-key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'x-api-key': '<api-key>'}};
fetch('https://console.mermail.app/api/v1/mailboxes/{mailboxId}/folders/{folderId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://console.mermail.app/api/v1/mailboxes/{mailboxId}/folders/{folderId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://console.mermail.app/api/v1/mailboxes/{mailboxId}/folders/{folderId}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://console.mermail.app/api/v1/mailboxes/{mailboxId}/folders/{folderId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.mermail.app/api/v1/mailboxes/{mailboxId}/folders/{folderId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{}{
"error": "Unauthorized"
}{
"error": "Invalid request"
}{
"error": "Forbidden"
}{
"error": "Too many requests"
}Authorizations
API key (sk-proj-…) from Settings → API Keys. Required for sold API calls outside the Mermail console.
Path Parameters
Mailbox public_id (UUID), hosted alias id, or current email
Folder id
Response
Deleted
The response is of type object.
⌘I