SDK / API ReferenceThreads
Delete Thread
Soft-delete a thread and all its messages
Scope: mail:manage
Soft-delete an entire thread along with every message inside it.
Request
import { Mailgent } from "@mailgent/sdk";
const mailgent = new Mailgent({ apiKey: process.env.MAILGENT_API_KEY! });
await mailgent.mail.deleteThread("thd_a3f91b00c4e2d7e8");import os
from mailgent import Mailgent
mailgent = Mailgent(api_key=os.environ["MAILGENT_API_KEY"])
mailgent.mail.delete_thread("thd_a3f91b00c4e2d7e8")mailgent threads delete thd_a3f91b00c4e2d7e8mail.delete_thread(thread_id)Available through @mailgent/mcp — see MCP setup.
curl -X DELETE https://api.mailgent.dev/v0/threads/thd_a3f91b00c4e2d7e8 \
-H "Authorization: Bearer loid-your-api-key"Path Parameters
| Param | Type | Description |
|---|---|---|
threadId | string | The thread ID to delete |
Response — 204 No Content
No body.
Errors
| Status | Code | Description |
|---|---|---|
404 | not_found | Thread not found or not accessible |