{"uid":"cap_zZvUnElbaljXyd4EbbpB_","slug":"agentmail-send-email-via-x402-53b07c72","name":"AgentMail Send Email via x402","description":"Send an email message from an inbox. At least one recipient (to, cc, or bcc) is required. Returns the message_id and thread_id. Replace {inbox_id} directly in the path with the full inbox email (e.g., /v0/inboxes/myagent@agentmail.to/messages/send).","url":"https://x402.orth.sh/agentmail/v0/inboxes/:inbox_id/messages/send","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"cc":{"type":"array","description":"CC recipient email address(es). String or array of strings."},"to":{"type":"array","description":"Recipient email address(es). At least one of to, cc, or bcc is required. Can be a string or array of strings."},"bcc":{"type":"array","description":"BCC recipient email address(es). String or array of strings."},"html":{"type":"string","description":"HTML body. Provide text, html, or both."},"text":{"type":"string","description":"Plain text body. Provide text, html, or both."},"labels":{"type":"array","description":"Array of label strings to tag the sent message."},"headers":{"type":"object","description":"Custom email headers as key-value pairs (e.g., {\"X-Custom\": \"value\"})."},"subject":{"type":"string","description":"Email subject line."},"reply_to":{"type":"array","description":"Reply-to address(es) if different from the inbox address."},"attachments":{"type":"array","description":"Array of attachment objects: {filename: string, content_type: string, content: string (base64)} or {filename: string, content_type: string, url: string}."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.01","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","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":"static","summary":"$0.01/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.01","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_fsLfIpD5m1UwPatlyrVHD","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.01","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Sends an email message from a specified AgentMail inbox, returning the message ID and thread ID","exampleAgentPrompt":"Send an email from myagent@agentmail.to to alice@example.com with the subject 'Meeting Follow-Up' and a plain text body saying 'Hi Alice, great meeting you today — here are the next steps we discussed.'","exampleUseCases":[{"title":"Agent sends onboarding email to new user","prompt":"Send a welcome email from onboarding@agentmail.to to newuser@example.com with subject 'Welcome aboard!' and an HTML body that says '<h1>Welcome!</h1><p>We're thrilled to have you. Here's how to get started.</p>'"},{"title":"Automated notification with CC to team","prompt":"Send an email from alerts@agentmail.to to the client at client@corp.com, CC our manager at boss@mycompany.com, with subject 'Your report is ready' and body 'Hi, your weekly analytics report has been generated and is attached.' and attach the PDF file report.pdf in base64."},{"title":"Reply-to-different-address follow-up","prompt":"Email john.doe@example.com from support@agentmail.to with subject 'Your support ticket #4821' and plain text body 'We've resolved your issue — please let us know if you need anything else.' Set the reply-to address to helpdesk@mycompany.com so replies go there instead."}],"resultDescription":"Returns a JSON object containing message_id (unique identifier for the sent message) and thread_id (identifier for the email thread the message belongs to), confirming successful delivery from the inbox.","failureModes":["Missing recipient — if none of to, cc, or bcc are provided, the request fails with a validation error","Invalid inbox_id — if the inbox email does not exist or is not accessible, returns a 404 or authorization error","Malformed email addresses — invalid email format in recipient fields causes rejection","Payment failure — x402 micropayment of $0.01 USDC not satisfied results in 402 Payment Required","Missing body — if neither text nor html body is provided, the message may be rejected","Invalid attachment format — attachments must include filename, content_type, and either base64 content or a URL; missing fields cause errors"],"whenToPreferThis":"Choose this endpoint when your AI agent needs to programmatically send outbound email from an AgentMail-managed inbox and you want to pay per-send via x402 micropayments (USDC) without managing SMTP infrastructure. It is ideal for agentic automation workflows where the sending identity is an agent-owned inbox (e.g., myagent@agentmail.to). Prefer this over general SMTP APIs when you need thread tracking (thread_id returned) and per-message cost accountability at $0.01 USDC.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T12:53:06.022Z","isFirstParty":false}