{"openapi":"3.1.0","info":{"title":"MailMoose API","version":"1.0.0","summary":"Email on your own domains: unlimited inboxes, a Resend-compatible sending API, and sign-up for AI agents.","description":"Agents can create an account for their user without the website: POST /api/agent/signup, then /api/agent/signup/verify with the code the user receives by email. That returns a full-access API key.\n\nEvery /api/v1 request needs `Authorization: Bearer <api key>`. Errors are `{ error: { code, message } }`, except the Resend-compatible POST /api/v1/emails, which answers in Resend's shape.\n\nGuides: https://www.mailmoose.dev/llms.txt"},"servers":[{"url":"https://www.mailmoose.dev"}],"security":[{"bearer":[]}],"tags":[{"name":"Agent sign-up","description":"Create or connect an account for the agent's user."},{"name":"Account"},{"name":"Domains"},{"name":"Addresses"},{"name":"Sending"},{"name":"Reading"}],"paths":{"/api/agent/signup":{"post":{"tags":["Agent sign-up"],"security":[],"operationId":"startAgentSignup","summary":"Email the user a 6-digit code","description":"Throwaway addresses are refused. Limited to 3 starts per address per hour.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email"}}}}}},"responses":{"202":{"description":"Code sent","content":{"application/json":{"schema":{"type":"object","properties":{"signupId":{"type":"string","format":"uuid"},"expiresInSeconds":{"type":"integer"},"message":{"type":"string"}}}}}},"400":{"description":"invalid_email or disposable_email","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/agent/signup/verify":{"post":{"tags":["Agent sign-up"],"security":[],"operationId":"verifyAgentSignup","summary":"Exchange the code for a full-access API key","description":"Creates the account on the free plan if the address has none. The key is returned once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["signupId","code"],"properties":{"signupId":{"type":"string","format":"uuid"},"code":{"type":"string","pattern":"^\\d{6}$"}}}}}},"responses":{"200":{"description":"Key issued","content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"string"},"accountCreated":{"type":"boolean"},"plan":{"type":"string","enum":["free"]},"apiBaseUrl":{"type":"string"},"message":{"type":"string"}}}}}},"400":{"description":"wrong_code (see attemptsLeft) or invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"403":{"description":"no_workspace","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"409":{"description":"login_exists: the user must sign in once in the browser","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"410":{"description":"expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"429":{"description":"too_many_attempts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}},"503":{"description":"unavailable: retry the same code shortly","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentError"}}}}}}},"/api/v1/me":{"get":{"tags":["Account"],"operationId":"getMe","summary":"The key's organization, scopes, usage and sending addresses (needs mail:read)","responses":{"200":{"description":"OK"},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/senders":{"get":{"tags":["Account"],"operationId":"listSenders","summary":"Validate a key and list its sending-ready addresses, without reading mail","responses":{"200":{"description":"OK"},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/domains":{"post":{"tags":["Domains"],"operationId":"connectDomain","summary":"Connect a domain; returns the DNS records still to add","description":"Idempotent: an already-connected domain answers 200 with created: false. Needs domains:write and an owner/admin.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"label":{"type":"string"}}}}}},"responses":{"200":{"description":"Already connected"},"201":{"description":"Connected"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/domains/{name}":{"get":{"tags":["Domains"],"operationId":"getDomain","summary":"Re-check a domain's DNS and verification (slow; not for tight polling)","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"},"example":"yourdomain.com"}],"responses":{"200":{"description":"OK"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/domains/{name}/sending":{"post":{"tags":["Domains"],"operationId":"enableSending","summary":"Turn on sending for a domain; returns the records that authorise it. Safe to repeat.","parameters":[{"name":"name","in":"path","required":true,"schema":{"type":"string"},"example":"yourdomain.com"}],"responses":{"200":{"description":"OK"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/addresses":{"get":{"tags":["Addresses"],"operationId":"listAddresses","summary":"List addresses","responses":{"200":{"description":"OK"}}},"post":{"tags":["Addresses"],"operationId":"createAddress","summary":"Create an address (inbox)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["localPart","domain"],"properties":{"localPart":{"type":"string","example":"hello"},"domain":{"type":"string"}}}}}},"responses":{"201":{"description":"Created"},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/messages":{"post":{"tags":["Sending"],"operationId":"sendMessage","summary":"Send an email","description":"New recipients need confirmNewRecipient: true, otherwise 409 confirmation_required. Do not retry a timed-out send automatically.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["from","to"],"properties":{"from":{"type":"string","description":"hello@yourdomain.com or \"Name <hello@yourdomain.com>\""},"to":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cc":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"bcc":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"reply_to":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"subject":{"type":"string"},"body":{"type":"string"},"text":{"type":"string"},"html":{"type":"string"},"campaign":{"type":"string","description":"Groups one automated email, e.g. password_reset"},"attachments":{"type":"array","items":{"type":"object","required":["filename","content"],"properties":{"filename":{"type":"string"},"content":{"type":"string","contentEncoding":"base64"},"content_type":{"type":"string"},"content_id":{"type":"string"}}}},"confirmNewRecipient":{"type":"boolean"}}}}}},"responses":{"201":{"description":"Accepted by the sending provider","content":{"application/json":{"schema":{"type":"object","properties":{"messageId":{"type":"string"},"threadId":{"type":"string"}}}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/emails":{"post":{"tags":["Sending"],"operationId":"sendEmailResendCompatible","summary":"Resend-compatible send (use with a send-only key)","description":"Takes Resend's request body and answers { id }. Resend's SDK works with RESEND_BASE_URL set to /api/v1.","responses":{"200":{"description":"Sent","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"}}}}}}}}},"/api/v1/emails/{id}":{"get":{"tags":["Sending"],"operationId":"getEmail","summary":"Status of an email this key sent (last_event)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/threads":{"get":{"tags":["Reading"],"operationId":"listThreads","summary":"Recent conversations","parameters":[{"name":"limit","in":"query","schema":{"type":"integer"}},{"name":"unread","in":"query","schema":{"type":"boolean"}},{"name":"address","in":"query","schema":{"type":"string"}},{"name":"q","in":"query","schema":{"type":"string"}},{"name":"include","in":"query","schema":{"type":"string","enum":["all"]}}],"responses":{"200":{"description":"OK"}}}},"/api/v1/threads/{threadId}":{"get":{"tags":["Reading"],"operationId":"getThread","summary":"A conversation with its messages","parameters":[{"name":"threadId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/threads/{threadId}/reply":{"post":{"tags":["Sending"],"operationId":"replyToThread","summary":"Reply within a conversation (recipients come from the conversation)","parameters":[{"name":"threadId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["body"],"properties":{"body":{"type":"string"},"replyAll":{"type":"boolean"}}}}}},"responses":{"201":{"description":"Sent"},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"A MailMoose API key (mm_live_…)"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}},"AgentError":{"type":"object","properties":{"error":{"type":"string"},"message":{"type":"string"},"attemptsLeft":{"type":"integer"}}}}}}