API referenceAttachments
Upload an attachment
POST
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.
bearerAuthheader
AuthorizationBearer <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.
multipart/form-data- body
file*fileFormat
binarymessage_id?stringOptional grouping key for the R2 path. A random uuid is used if omitted.
Uploaded.
application/json- response
r2_key?stringfilename?stringcontent_type?stringsize?integerFormat
int64curl -X POST "https://example.com/v1/attachments" \ -F file="string"{ "r2_key": "string", "filename": "string", "content_type": "string", "size": 0}