COSS
Emails

Send a batch of emails

POST
/v1/emails/batch

Queues up to 100 emails in one request. Each email is handled exactly as by POST /v1/emails (sender checks, suppressions, scheduling, attachments, tracking), but the batch is all or nothing: if any email is invalid, or any from is not a verified domain (live keys), nothing is stored and the error names the email (e.g. emails.3.to). One Idempotency-Key covers the whole batch. The emails' recipients are charged against the send quota together, so a batch with more recipients than the quota allows at once is refused (quota_exceeded without Retry-After): split it. The request body shares the 40 MB limit of a single send.

Authorization

bearerAuth
headerAuthorizationBearer <token>

A secret API key from the dashboard: coss_live_… for production environments, coss_test_… for sandbox environments.

Header Parameters

Idempotency-Key?string

Makes retries safe: a repeated request with the same key and body returns the original email (with its current status) instead of sending again, for 24 hours. 1-256 characters.

Length1 <= length <= 256
Coss-Version?"2026-10-10"

The API version (a date) to use for this request. Defaults to your organization's version, pinned to the latest one when it first used the API and upgraded from the dashboard. The SDK always sends the version it was built for.

Value in"2026-10-10"

Request Body

application/json
  1. body
emails*array<>

Up to 100 emails, each accepted by POST /v1/emails. The batch is accepted or rejected as a whole.

Items1 <= items <= 100

Response Body

The batch, accepted for delivery, with its emails in request order. A replay returns the original batch with the emails' current statuses.

application/json
  1. response
object*"email_batch"
Value in"email_batch"
id*string
data*array<>

The batch's emails, in the order of the request.

created_at*string
Formatdate-time
import { Coss } from "coss";const coss = new Coss({  apiKey: process.env.COSS_API_KEY,  baseUrl: "https://api.coss.com",});const { data, error } = await coss.email.sendBatch([  {    from: "Acme <notifications@acme.com>",    to: "ada@example.com",    subject: "Your weekly summary",    html: "<p>Hi Ada, here is your week.</p>",    category: "digest",  },  {    from: "Acme <notifications@acme.com>",    to: "grace@example.com",    subject: "Your weekly summary",    html: "<p>Hi Grace, here is your week.</p>",    category: "digest",  },]);
{  "object": "email_batch",  "id": "batch_01k8d0n6x5f3w2e1r9t7y4u6i8",  "data": [    {      "object": "email",      "id": "email_01k7c8m4q2f3e9v6t5r1n0p8yz",      "from": "Acme <notifications@acme.com>",      "to": [        "ada@example.com"      ],      "cc": [],      "bcc": [],      "reply_to": [],      "subject": "Your weekly summary",      "html": "<p>Hi Ada, here is your week.</p>",      "text": null,      "headers": {},      "tags": [],      "category": "digest",      "status": "queued",      "recipients": [        {          "address": "ada@example.com",          "type": "to",          "status": "queued",          "last_event_at": null        }      ],      "sandbox": false,      "tracking": {        "opens": false,        "clicks": false,        "open_count": 0,        "first_opened_at": null,        "last_opened_at": null,        "click_count": 0,        "first_clicked_at": null,        "last_clicked_at": null      },      "attachments": [],      "created_at": "2026-10-10T12:00:00.000Z",      "sent_at": null,      "scheduled_at": null,      "batch_id": "batch_01k8d0n6x5f3w2e1r9t7y4u6i8"    }  ],  "created_at": "2026-10-10T12:00:00.000Z"}