Skip to Content
POST
/api/v1/mailboxes/{mailboxId}/messages

Stores raw RFC 5322 email bytes directly into a mailbox under a label without sending (similar to IMAP APPEND). Supports custom flags, Sieve filtering, and historical internaldate. Lone CR and LF are normalized to CRLF before storage; the size limit applies to the normalized message.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Two credential kinds share this scheme; GET /api/v1/auth/whoami answers which one you hold and what it reaches.

oek_… API key (minted by POST /api/v1/api-keys; shown once at mint). role: account reaches the full account surface: the directory (domains, routes, patterns, api-keys, accounts, address lists) plus every mailbox the account owns. role: system additionally reaches the operator surface, which is documented separately.

oemp_… mailbox app password (minted by POST /api/v1/identities/{identityId}/credentials). Reaches ONE mailbox: its messages, labels, threads, search, sync, send, filters and PIM collections. Directory routes refuse it with 403 insufficient_scope.

Refusal vocabulary: a missing, malformed, expired, or revoked credential answers 401 unauthorized with a WWW-Authenticate: Bearer challenge; a VALID credential outside its scope answers 403 (insufficient_scope for an app password on a directory route, system_credentials_required where only the operator may call). The public routes (health, branding, token-in-path capabilities) declare security: [].

Path Parameters

mailboxId*string

Mailbox ULID identifier

Query Parameters

label?string

Target label or folder (default INBOX)

flags?string

Comma-separated initial flags, e.g. seen,draft

keywords?string

Comma-separated initial keywords (e.g. $forwarded,$mdnsent), committed WITH the store flip — an IMAP APPEND with keywords is one call rather than a POST followed by a PATCH. Flag-shaped keywords ($seen, $answered, $flagged, $draft) fold onto their flag bit.

Lengthlength <= 2048
filter?string

Whether to run the mailbox's active Sieve filter on this append (default false)

Value in"true""false"
internaldate?|

Original receive timestamp in epoch seconds for migration/import (default now)

Range-62135596800 <= value <= 253402300799

Header Parameters

x-envelope-from?string

Envelope sender email address

x-envelope-to?string

Envelope recipient email address

x-delivery-id?string

Optional client idempotency key to prevent duplicate imports. Stored NAMESPACED as append:<your id> (an append is the mailbox's own side writing its own row, announced as message.imported, not message.new), so the traffic log and the filtered response show that form — retry with your original value.

content-length?string

Message payload size in bytes (required)

Request Body

body*stringmessage/rfc822

Raw RFC 5322 message bytes

Response Body

Message appended successfully

application/json
  1. response
blobHash?string

On a fresh store: the blob SHA-256 (what body caches key on)

duplicate*boolean

True if message was already delivered previously

flags?array<string>

On a fresh store: the flags the row was stored with

keywords?array<string>

On a fresh store: the keywords the row was stored with

messageId*string

Assigned message ULID

modseq?integer

On a fresh store: the membership row's MODSEQ in the target label

Formatint64
receivedAt?integer

On a fresh store: the INTERNALDATE in epoch seconds

Formatint64
size?integer

On a fresh store: the stored size in bytes

Formatint64
status*"delivered"

Message was successfully delivered and stored

Value in"delivered"
threadId*|

Assigned conversation thread ULID, or null on duplicate

uid*|

Assigned message UID, or null on duplicate

Formatint64
uidValidity*|

Label UID validity epoch, or null on duplicate

Formatint64
Example Request
curl -X POST 'https://api.open.email/api/v1/mailboxes/string/messages' \
  -H 'Content-Type: message/rfc822' \
  -d 'string'
Example Response
{
  "blobHash": "string",
  "duplicate": true,
  "flags": [
    "string"
  ],
  "keywords": [
    "string"
  ],
  "messageId": "string",
  "modseq": 0,
  "receivedAt": 0,
  "size": 0,
  "status": "delivered",
  "threadId": "string",
  "uid": 0,
  "uidValidity": 0
}