{"uid":"cap_aa36zJjQT9fvNfIpPnR22","slug":"agentmail-thread-id-cb228384","name":"AgentMail Delete Thread","description":"Moves the thread to trash by adding a trash label to all messages. If the thread is already in trash, it will be permanently deleted. Use `permanent=true` to force permanent deletion.","url":"https://mpp.api.agentmail.to/v0/pods/:pod_id/threads/:thread_id?utm_source=zero.xyz","method":"DELETE","headers":{},"bodySchema":{"type":"object","required":["pod_id","thread_id"],"properties":{"pod_id":{"type":"string","title":"PodId","description":"ID of pod."},"permanent":{"type":"boolean","description":"If true, permanently delete the thread instead of moving to trash."},"thread_id":{"type":"string","title":"ThreadId","description":"ID of thread."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["email","inboxes","domains","drafts","threads","webhooks","messaging","ai","social"],"displayCostAmount":"0","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"proven_free","priceSource":"unknown","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"free","summary":"Free","primary":null,"accepted":[]},"paymentMethods":[],"brandName":"AgentMail","brandSlug":"agentmail","brandBaseUrl":"https://agentmail.to","brandDocsUrl":"https://docs.agentmail.to","whatItDoes":"Moves an email thread to trash (or permanently deletes it) within an AgentMail pod","exampleAgentPrompt":"Trash the email thread with ID thread_abc123 in my AgentMail pod pod_xyz456 — and if it's already in trash, go ahead and permanently delete it.","exampleUseCases":[{"title":"Clean up spam and unwanted emails","prompt":"I'm getting a lot of junk emails from the same sender. Can you move all those threads to trash in my AgentMail pod? If any of them are already trashed, just permanently delete them to free up space."},{"title":"Remove sensitive conversations permanently","prompt":"I have some old email threads with confidential information that I need completely gone. Go ahead and permanently delete these thread IDs from my AgentMail pod without keeping them in trash."},{"title":"Archive agent mailbox after campaign","prompt":"We just wrapped up a client project and I want to clean out my agent inbox. Move all the related email threads to trash, and then permanently purge them so they don't clutter the pod anymore."}],"resultDescription":"A confirmation that the thread has been moved to trash (or permanently deleted if it was already trashed or if permanent=true was passed). The thread and all its messages are removed from active view or fully purged.","failureModes":["Thread not found: 404 if the thread_id does not exist in the specified pod","Pod not found: 404 if the pod_id is invalid or inaccessible","Unauthorized: 401 if the Authorization Bearer token is missing or invalid","Already deleted: attempting to delete a thread that no longer exists may return 404","Permission denied: 403 if the caller does not own or have access to the pod"],"whenToPreferThis":"Use this endpoint when an AI agent needs to programmatically clean up email threads within an AgentMail pod — either soft-trashing them for recovery later or permanently removing them. Prefer this over archiving when the thread content is no longer needed. Use permanent=true when you want to bypass the two-step trash flow and immediately purge the thread.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-10T00:45:45.488Z","isFirstParty":false,"canonicalSlug":"agentmail-thread-id-a7fb9855"}