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

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.

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

Header Parameters

content-length*string

Exact size of the uploaded binary in bytes

content-type?string

MIME type of the uploaded file (default application/octet-stream)

Request Body

body*fileapplication/octet-stream

The file's raw bytes, streamed as sent

Formatbinary

Response Body

Staged upload metadata

application/json
  1. response
blobId*string

Opaque upload id (u_…); pass it as an attachment's blobId, or to JMAP as a blobId

expiresAt*integer

Epoch seconds after which the upload is treated as gone — reference it before then

Formatint64
size*integer

Stored byte length

Formatint64
type*string

The media type recorded for the blob (echoes the request Content-Type)

Example Request
curl -X POST 'https://api.open.email/api/v1/mailboxes/string/uploads' \
  -H 'content-length: string' \
  -H 'Content-Type: application/octet-stream' \
  -d 'string'
Example Response
{
  "blobId": "01J9B0B4D7F1H3K6M000000000",
  "expiresAt": 1788436800,
  "size": 48123,
  "type": "application/pdf"
}