API reference
The complete public endpoint surface for mailboxes, threads, messages, attachments, and webhooks.
Mailboxes
/v1/mailboxesmailboxes:readLists mailboxes accessible to the key. Each item includes id, address, displayName, visibility, capability flags, and unreadCount.
Threads
/v1/threadsmail:readLists thread summaries. Optional query parameters are mailbox=<mailbox_id> and label=inbox|starred|sent|drafts|important|spam.
/v1/threads/:idmail:readReturns a thread and its messages. A missing or inaccessible thread returns 404.
Messages
/v1/messagesmail:sendQueues a new message or reply.
{
"mailboxId": "mbx_123",
"to": ["customer@example.com"],
"cc": [],
"bcc": [],
"subject": "Re: Account access",
"text": "I reset the link for you.",
"html": "<p>I reset the link for you.</p>",
"replyToMessageId": "msg_456",
"attachmentIds": []
}
to requires 1–10 addresses. cc and bcc each accept up to 10. Subject is limited to 240 characters; text and HTML bodies are limited to 250,000 characters each. replyToMessageId, html, cc, and bcc are optional.
Attachments
/v1/attachmentsmail:sendAccepts multipart/form-data with one file in the file field. Returns attachment metadata and an expiry time.
/v1/attachments/:idmail:readDownloads an authorized attachment as bytes with its content type and safe filename.
Webhooks
/v1/webhookswebhooks:writeLists configured endpoints without exposing their signing secrets.
/v1/webhookswebhooks:writeCreates an HTTPS endpoint. eventTypes must include at least one supported event. The signing secret is returned once.
{
"url": "https://example.com/startupmail/events",
"description": "Production mail worker",
"eventTypes": ["message.received", "message.failed"]
}
/v1/webhooks/:idwebhooks:writeDeletes an endpoint and returns 204.
Supported webhook events
message.received, message.sent, message.delivered, message.failed, and domain.verified.