Skip to navigation

Send Message Batch

Send 1 to 100 messages in one request. Results are positional: the i-th element of items is the outcome of the i-th message you sent.

RRay-Batch-Validation: strict (the default) rejects the whole batch with 422 if any message is invalid and sends nothing; permissive sends the valid messages and returns a per-position error object for each invalid one. Allowance rejections are positional too: all accepted is 202, some turned away for allowance is 207, and a batch refused in full is one top-level 402, 403 or 429 naming the ceiling that stopped it.

207 Multi-Status means exactly one thing: part of the batch was turned away by an allowance ceiling. A delivery failure on an otherwise-sent batch is not a 207 — that position carries message.injection_failed and the batch stays 202, because the request itself was accepted.

Authentication

AuthorizationBearer

A workspace key (rray_live_…, bound to one workspace) or the account’s platform key. Platform keys name the target workspace with RRay-Workspace-Id. See Credentials.

Headers

RRay-Batch-ValidationstringOptionalDefaults to strict

strict (the default) rejects the whole batch with 422 if any message is invalid and sends nothing; permissive sends the valid messages and returns a per-position error object for each invalid one.

Idempotency-Keystring or nullOptional

Makes a retry safe. The first request with a key performs the batch; a retry with the same key and the same body replays the whole positional result, sending nothing again. The same key with a different body is 409 idempotency.body_mismatch. Claims are kept for 24 hours, then the key is free to reuse. Omit the header and every attempt sends.

RRay-Workspace-Idstring or nullOptional

The workspace to act on. Required with a platform key; rejected with a workspace key, which already carries its workspace — a matching value is rejected too, rather than silently ignored. An id that is not yours returns 404 workspace.not_found.

Request

This endpoint expects a list of objects.
fromstringRequired

Sender address, optionally with a display name (Acme Receipts <receipts@mail.rray.app>). Use an address on a sending domain you have added, so the message can be signed — unsigned mail is very likely to be refused by the recipient’s provider.

tolist of stringsRequired

Primary recipients, at least one. An address may not repeat anywhere across to, cc and bcc.

cclist of strings or nullOptional

Carbon-copy recipients. Visible to every recipient.

bcclist of strings or nullOptional

Blind carbon-copy recipients. Not visible to other recipients, but each one is a delivery you can track like any other.

reply_tostring or list of strings or nullOptional

Where replies should go instead of from — one address or several.

subjectstring or nullOptional

Subject line. Single-line text.

htmlstring or nullOptional

HTML body. Send html, text, or both; with both, the recipient’s client picks the part it prefers.

textstring or nullOptional

Plain-text body.

attachmentslist of objects or nullOptional
Files to attach, totalling at most 10 MiB once decoded.

Response

Successful Response
summaryobject

Per-request tally so the caller can branch without scanning items. Endpoint- agnostic (total / success_count / error_count mirror the result discriminator) so every batch response across the API reuses this one model.

itemslist of objects

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
413
Content Too Large Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
502
Bad Gateway Error