Batch delete mailbox messages
curl --request POST \
--url https://app.sendmux.ai/api/v1/mailbox/messages:batch-delete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"<string>"
]
}
'import requests
url = "https://app.sendmux.ai/api/v1/mailbox/messages:batch-delete"
payload = { "ids": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: ['<string>']})
};
fetch('https://app.sendmux.ai/api/v1/mailbox/messages:batch-delete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.sendmux.ai/api/v1/mailbox/messages:batch-delete"
payload := strings.NewReader("{\n \"ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"ok": true,
"data": {
"deleted": [
"<string>"
],
"failed": [
{
"code": "<string>",
"id": "<string>",
"message": "<string>"
}
],
"not_found": [
"<string>"
],
"states": {
"new_state": "<string>",
"old_state": "<string>"
}
}
}{
"error": {
"code": "invalid_parameter",
"message": "<string>",
"retryable": false,
"doc_url": "<string>",
"errors": [
{
"code": "invalid_string",
"field": "recipient.email",
"message": "<string>"
}
],
"param": "<string>"
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"ok": false
}{
"error": {
"code": "invalid_parameter",
"message": "<string>",
"retryable": false,
"doc_url": "<string>",
"errors": [
{
"code": "invalid_string",
"field": "recipient.email",
"message": "<string>"
}
],
"param": "<string>"
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"ok": false
}{
"error": {
"code": "invalid_parameter",
"message": "<string>",
"retryable": false,
"doc_url": "<string>",
"errors": [
{
"code": "invalid_string",
"field": "recipient.email",
"message": "<string>"
}
],
"param": "<string>"
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"ok": false
}Messages
Batch delete mailbox messages
Moves up to 100 messages to Trash by default with state-safe conflict handling. Set permanent=true to permanently delete them.
POST
/
mailbox
/
messages:batch-delete
Batch delete mailbox messages
curl --request POST \
--url https://app.sendmux.ai/api/v1/mailbox/messages:batch-delete \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"<string>"
]
}
'import requests
url = "https://app.sendmux.ai/api/v1/mailbox/messages:batch-delete"
payload = { "ids": ["<string>"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: ['<string>']})
};
fetch('https://app.sendmux.ai/api/v1/mailbox/messages:batch-delete', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.sendmux.ai/api/v1/mailbox/messages:batch-delete"
payload := strings.NewReader("{\n \"ids\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"ok": true,
"data": {
"deleted": [
"<string>"
],
"failed": [
{
"code": "<string>",
"id": "<string>",
"message": "<string>"
}
],
"not_found": [
"<string>"
],
"states": {
"new_state": "<string>",
"old_state": "<string>"
}
}
}{
"error": {
"code": "invalid_parameter",
"message": "<string>",
"retryable": false,
"doc_url": "<string>",
"errors": [
{
"code": "invalid_string",
"field": "recipient.email",
"message": "<string>"
}
],
"param": "<string>"
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"ok": false
}{
"error": {
"code": "invalid_parameter",
"message": "<string>",
"retryable": false,
"doc_url": "<string>",
"errors": [
{
"code": "invalid_string",
"field": "recipient.email",
"message": "<string>"
}
],
"param": "<string>"
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"ok": false
}{
"error": {
"code": "invalid_parameter",
"message": "<string>",
"retryable": false,
"doc_url": "<string>",
"errors": [
{
"code": "invalid_string",
"field": "recipient.email",
"message": "<string>"
}
],
"param": "<string>"
},
"meta": {
"request_id": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx"
},
"ok": false
}Authorizations
Sendmux API key. Use a root API key for Management API routes, or a mailbox credential for Mailbox API routes. Obtain keys from the dashboard under API Keys.
Query Parameters
Mailbox public ID to target when the credential grants access to more than one mailbox. Omit when the credential is scoped to exactly one mailbox.
Body
application/json
Response
Batch delete result
Available options:
true Hide child attributes
Hide child attributes
Was this page helpful?
⌘I