Charchy Senddocs

Send a batch

Up to 100 emails in one request, without attachments. Validation is all-or-nothing: one invalid email and nothing is sent, with every problem listed by index. Charged once for the whole batch.

POST
/emails/batch

Up to 100 emails in one request, without attachments. Validation is all-or-nothing: one invalid email and nothing is sent, with every problem listed by index. Charged once for the whole batch.

apiKey
headerAuthorizationBearer <token>

Authorization: Bearer chy_live_… (or chy_test_…). A live key may be sending-only, and may be locked to one domain.

Idempotency-Key?string

1–256 characters, no control characters, kept 24 hours per workspace. The same key with the same body returns the first response again; with a different body, 409 idempotency_conflict; an empty, too long or malformed key, 400 invalid_idempotency_key. Send one on every request, e.g. <event-type>/<entity-id>.

Length1 <= length <= 256
application/json
  1. body
emails*array<>

Same fields as a single email, without attachments.

Items1 <= items <= 100

Response Body

Every email accepted. Ids are in request order.

application/json
  1. response
emails*array<>
Example Request
import { CharchySend } from "@charchy/send"const send = new CharchySend() // reads CHARCHY_SEND_KEYconst { data, error } = await send.emails.batch(  [    {      from: "Darin Game <orders@daringaming.com>",      to: "Darin Game <orders@daringaming.com>",      subject: "string",    },  ],  { idempotencyKey: "order-confirmation/4821" })
Example Response
{  "emails": [    {      "id": "em_8f2k1x9q4w7m3n5p6r0s2t4v",      "status": "scheduled"    }  ]}