MAILGENT
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_a3f91b00c4e2d7e8
mail.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

ParamTypeDescription
threadIdstringThe thread ID to delete

Response — 204 No Content

No body.

Errors

StatusCodeDescription
404not_foundThread not found or not accessible

On this page