API referenceAttachments

Upload an attachment

POST
/v1/attachments

Uploads a file to R2 under {tenant_id}/{message_id}/{filename}. Returns an r2_key to reference in a SendRequest's attachments[].r2_key. message_id is an arbitrary caller-chosen grouping value (defaults to a random uuid if omitted) — it does not have to be a real message id ahead of time. Max 10 MB.

Authorization

bearerAuth
headerAuthorizationBearer <token>

API key sent as Authorization: Bearer <key>. Looked up by SHA-256 hash (email_core::sha256_hex) against api_keys.hash; revoked keys and keys belonging to a suspended tenant are rejected. See the top-level Authentication section for permission levels.

Request Body

multipart/form-data
  1. body
file*file
Formatbinary
message_id?string

Optional grouping key for the R2 path. A random uuid is used if omitted.

Response Body

Uploaded.

application/json
  1. response
r2_key?string
filename?string
content_type?string
size?integer
Formatint64
curl -X POST "https://example.com/v1/attachments" \  -F file="string"
{  "r2_key": "string",  "filename": "string",  "content_type": "string",  "size": 0}