Send an email
/drafts/sendThe only irreversible action in this API: it leaves the system and reaches a third party.
Requires the write scope AND allowOutboundSend enabled on the key: the scope alone is
deliberately not enough. Always send an Idempotency-Key: a retry after a network timeout
would otherwise deliver the message twice.
Authorization
apiKey Send your key as Authorization: Bearer mk_…. Session cookies are never accepted on this surface.
In: header
Header Parameters
A unique value per operation, such as a UUID. Replays the stored response for 24h. Reusing a key with a different body returns 409.
length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/drafts/send" \ -H "Authorization: Bearer $MAYLEE_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "body": { "text": "Hello Jane, here is the quote you asked for." }, "inReplyTo": "<CAF3k9x1@mail.example.com>", "mailboxId": "cmbx1a2b3c4d5e6f7g8h9i0j", "references": [ "<CAF3k9x1@mail.example.com>" ], "subject": "Re: Quote request", "to": [ { "email": "client@acme.com", "name": "Jane Client" } ] }'{ "messageId": "<20260825140233.1a2b3c@your-company.com>", "threadId": "18c2f5a9e7b1d3c4"}Create a draft POST
Creates a draft in one of the workspace mailboxes without sending it. The draft shows up immediately in the Maylee app, where a person reviews it, edits it and sends it: this is the way to prepare an email from an integration or an agent while keeping a human in the loop. Nothing leaves the workspace, so the `write` scope is enough: `allowOutboundSend` is not required. Attachments cannot be added through the API.
List connected mailboxes GET
Call this to resolve the `mailboxId` every send and most filters need.