{"uid":"cap_A-iXZpv93WwGSiLPYM7f1","slug":"mermail-email-context-retrieval-c07f1995","name":"Mermail Email Context Retrieval","description":"An inbox and wallet for your AI agent. Find and nurture sales leads, resolve customer support, and handle online purchases with controlled payments.","url":"https://console.mermail.app/api/agent/v1/mailboxes/%7BmailboxId%7D/emails/%7BemailId%7D/context?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET","HEAD","DELETE"],"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}},"queryParams":{"type":"object","properties":{"limit":{"type":"integer","maximum":50,"minimum":1},"cursor":{"type":"string","maxLength":2048}},"additionalProperties":false}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","required":["email","thread"],"properties":{"email":{"type":"object","required":["id","subject","sender","recipient","date"],"properties":{"id":{"type":"string"},"body":{"type":"string"},"date":{"type":"string","format":"date-time"},"read":{"type":"boolean"},"sender":{"type":"string"},"snippet":{"type":"string"},"subject":{"type":"string"},"recipient":{"type":"string"},"thread_id":{"type":["string","null"]},"scan_status":{"enum":["clean","flagged","skipped",null],"type":["string","null"]},"content_omitted":{"type":"boolean"}},"additionalProperties":true},"thread":{"type":"object","required":["id","messages","total_count","has_more","next_cursor"],"properties":{"id":{"type":"string"},"has_more":{"type":"boolean"},"messages":{"type":"array","items":{"type":"object","required":["id","subject","sender","recipient","date"],"properties":{"id":{"type":"string"},"body":{"type":"string"},"date":{"type":"string","format":"date-time"},"read":{"type":"boolean"},"sender":{"type":"string"},"snippet":{"type":"string"},"subject":{"type":"string"},"recipient":{"type":"string"},"thread_id":{"type":["string","null"]},"scan_status":{"enum":["clean","flagged","skipped",null],"type":["string","null"]},"content_omitted":{"type":"boolean"}},"additionalProperties":true}},"next_cursor":{"type":["string","null"]},"total_count":{"type":"integer","minimum":0}},"additionalProperties":false}},"additionalProperties":false}}}}},"responseSchema":{"type":"json","example":{"email":{"id":"email_1","date":"2026-09-20T00:00:00.000Z","sender":"noreply@example.com","subject":"Verification code","recipient":"agent@mermail.app","scan_status":"clean"},"thread":{"id":"thread_1","has_more":false,"messages":[{"id":"email_1","date":"2026-09-20T00:00:00.000Z","sender":"noreply@example.com","subject":"Verification code","recipient":"agent@mermail.app","scan_status":"clean"}],"next_cursor":null,"total_count":1}}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"unprobed","priceSource":"registry","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":"unknown","summary":"price unknown","primary":{"kind":"unknown","protocol":"x402","network":"base","amountUsd":null,"per":"call","confidence":"unknown"},"accepted":[{"kind":"unknown","protocol":"x402","network":"base","amountUsd":null,"per":"call","confidence":"unknown"}]},"paymentMethods":[{"uid":"pm_A99FboDShQCC38AX9_LFP","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0","costPer":"request","priority":0,"asset":"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Retrieves a specific email and its full thread context from an agent's Mermail mailbox","exampleAgentPrompt":"Pull up email email_1 from my Mermail mailbox mailbox_42 and show me the full thread context, including all previous messages in that conversation.","exampleUseCases":[{"title":"Customer support thread review","prompt":"Fetch email email_99 from my Mermail mailbox mailbox_support and show me the full conversation thread so I know everything the customer has said before I draft a reply."},{"title":"Sales lead follow-up context","prompt":"Get me the email with ID email_lead_55 from mailbox mailbox_sales on Mermail, including the whole thread history, so I can see where we left off with this prospect."},{"title":"Verification code email lookup","prompt":"Read email email_vc_7 from my Mermail mailbox mailbox_signup and show me the thread — I need to see the verification code and confirm the email is marked clean."}],"resultDescription":"Returns a JSON object with two keys: 'email' (the specific message with id, subject, sender, recipient, date, body, snippet, read status, thread_id, scan_status, and content_omitted flag) and 'thread' (the full conversation thread including all messages, total count, has_more flag, and next_cursor for pagination).","failureModes":["Invalid or non-existent mailboxId returns a 404 not found error","Invalid or non-existent emailId returns a 404 not found error","Unauthorized access returns a 401 or 403 if the agent lacks permission for the mailbox","Malformed cursor parameter causes a 400 bad request","Email content may be omitted (content_omitted: true) if flagged or scan_status is not clean"],"whenToPreferThis":"Use this endpoint when your agent needs to read a specific email AND its full conversation thread context — for example, before drafting a reply to a customer, following up on a sales lead, or processing a verification code. Prefer this over a list endpoint when you already have a specific emailId and need full message body and thread history.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-11T00:37:00.530Z","isFirstParty":false,"canonicalSlug":"mermail-email-context-retrieval-c07f1995"}