Remove mailbox
Permanently deletes a mailbox. Without force, fails if the mailbox
is used in any active campaign — remove it from campaigns first.
With force=true (query, or { "force": true } in the body), the
mailbox is first removed from every non-archived campaign that uses
it (each campaign is rebalanced by the scheduler), then deleted —
same as the dashboard's "Remove from campaigns and force delete".
curl -X DELETE "https://api.sendkit.ai/v1/mailboxes/example_string?force=false" \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY"
import requests
import json
url = "https://api.sendkit.ai/v1/mailboxes/example_string?force=false"
headers = {
"Content-Type": "application/json",
"X-Api-Key": "YOUR_API_KEY"
}
response = requests.delete(url, headers=headers)
print(response.json())
const response = await fetch("https://api.sendkit.ai/v1/mailboxes/example_string?force=false", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
"X-Api-Key": "YOUR_API_KEY"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("DELETE", "https://api.sendkit.ai/v1/mailboxes/example_string?force=false", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-Api-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.sendkit.ai/v1/mailboxes/example_string?force=false')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(uri)
request['Content-Type'] = 'application/json'
request['X-Api-Key'] = 'YOUR_API_KEY'
response = http.request(request)
puts response.body
{
"success": true,
"data": {
"message": "Mailbox removed"
}
}
{
"success": true,
"data": {
"message": "Mailbox removed",
"removedFromCampaigns": [
{
"id": "665f1c2e9b1e8a00aaaa0001",
"name": "Q4 Outbound",
"removedCount": 1
}
]
}
}
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Mailbox is used in 2 active campaign(s). Remove it from campaigns first, or pass force=true."
}
}
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Mailbox not found"
}
}
/v1/mailboxes/{mailboxId}Target server for requests. Edit to use your own host.
Platform API key (sk_user_...) or Workspace API key (sk_...)
Mailbox ID
Remove the mailbox from its campaigns, then delete it.
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Platform API key (sk_user_...) or Workspace API key (sk_...)
Path Parameters
Mailbox ID
Query Parameters
Remove the mailbox from its campaigns, then delete it.