Charchy Senddocs

Cancel an email

Cancels an email that is `scheduled` or `queued`. It is refunded and fires `email.canceled`.

POST
/emails/{id}/cancel

Cancels an email that is scheduled or queued. It is refunded and fires email.canceled.

apiKey
headerAuthorizationBearer <token>

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

id*string
Match^em_

Response Body

Canceled.

application/json
  1. response
id*string
status*EmailStatus

sent = our delivery infrastructure accepted it; delivered = the receiving server did. unknown = no delivery event 30 minutes after an uncertain send (never re-sent; the charge stays).

With several recipients the status sums them up: complained if any recipient complained, else bounced if any bounced, else delivered once EVERY recipient was delivered, else delivery_delayed if any is delayed, else sent. Each recipient's own events are in events, with recipient.

Value in"scheduled""queued""sending""sent""delivered""delivery_delayed""bounced""complained""canceled""expired""suppressed""failed""unknown"
Example Request
import { CharchySend } from "@charchy/send"const send = new CharchySend() // reads CHARCHY_SEND_KEYconst { data, error } = await send.emails.cancel("em_8f2k1x9q4w7m3n5p6r0s2t4v")
Example Response
{  "id": "em_5k2m8x1q9w3r3n5p6r0s2t4v",  "status": "canceled"}