Skip to content

SDK method

emails.batch

POST /emails/batch

send an array of messages, per-item results.

Signature

ts
batch(inputs: SendEmailRequest[]): Promise<BatchResponse>

Parameters

NameTypeRequiredDescription
fromstring | AddressyesSender — `"Name <addr>"`, a bare address, or an `Address`. The domain owns the Message-ID.
toRecipientsyes—
ccRecipientsno—
bccRecipientsno—
subjectstringyes—
htmlstringno—
textstringno—
templatestringnoRender a stored template by id or name, substituting `data` merge tags (`*|FNAME|*`, conditionals, …) server-side — the "ad-hoc mailer with dynamic templates" path. Mutually exclusive with `html` (a template renders the html for you). A server that doesn't have the named template REJECTS the send with a clear error (never a silent empty send).
dataRecord<string, unknown>noMerge-tag values for `template` (keyed by tag, e.g. `{ FNAME: "Ada" }`).
reply_tostring | AddressnoReply-To header, wire format.
replyTostring | AddressnoJS-friendly alias for `reply_to`.
headersRecord<string, string>noExtra headers — `X-*` only (others are rejected 422).
in_reply_tostringnoMessage-ID this send replies to (TBX-29). Threads the send onto that existing conversation instead of starting a new one — both on the wire (real In-Reply-To/References headers) and in the Sent folder.
inReplyTostringnoJS-friendly alias for `in_reply_to`.
referencesstring[]noFull ancestry chain, oldest first. Usually the parent's `references` + its Message-ID.
attachmentsAttachment[]no—
idempotency_keystringnoIdempotency key. The HTTP API also accepts an `Idempotency-Key` header.
idempotencyKeystringnoJS-friendly alias for `idempotency_key`.
onReplyDirectiveActionnoAttach reply logic to this thread (GTM-thread-directives): when a reply lands on the thread this send starts, the platform's inbound pipeline honors this directive — draft/send/ask/notify. One call, one thread, zero new client concepts. A server that predates directives REJECTS this field with a clear error (never silently drops it). Snake `on_reply` is also accepted.
on_replyDirectiveActionno—
dripDripStep[]noA timed follow-up sequence on this thread — each step fires after its `after` delay (only if no reply arrived, unless `ifNoReply:false`). "send + onReply + drip in one call." Snake `drip` is the same field (no alias needed).

Returns

Promise<BatchResponse>

Example

ts
await tinbox.emails.batch([{ from, to, subject, html }, { from, to, subject, html }]);