Stage a binary attachment upload
Streams the request body (the file's raw bytes, NOT base64, NOT multipart) into staging storage and returns a blobId to reference from /send, /compose or /reply (the blobId form of an attachment). Content-Length is required and enforced against the per-message size ceiling. The staged blob expires at the result's expiresAt, or earlier when the uploader's oldest temporary blobs must be reclaimed for a new upload. Recorded send retries recover their durable message bytes.
bearerAuthAuthorizationBearer <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: [].
mailboxId*stringMailbox ULID identifier
content-length*stringExact size of the uploaded binary in bytes
content-type?stringMIME type of the uploaded file (default application/octet-stream)
body*fileapplication/octet-streamThe file's raw bytes, streamed as sent
binaryStaged upload metadata
application/json- response
blobId*stringOpaque upload id (u_…); pass it as an attachment's blobId, or to JMAP as a blobId
expiresAt*integerEpoch seconds after which the upload is treated as gone — reference it before then
int64size*integerStored byte length
int64type*stringThe media type recorded for the blob (echoes the request Content-Type)
curl -X POST 'https://api.open.email/api/v1/mailboxes/string/uploads' \
-H 'content-length: string' \
-H 'Content-Type: application/octet-stream' \
-d 'string'{
"blobId": "01J9B0B4D7F1H3K6M000000000",
"expiresAt": 1788436800,
"size": 48123,
"type": "application/pdf"
}