Resend a bounced message

After a soft bounce (mailbox full, temporary server issue), the recipient is suppressed but you may want to try again once you've confirmed the reason is resolved.

1. Remove the suppression

curl -X DELETE https://api.sendoka.com/api/v1/suppressions/user@example.com \
  -H "Authorization: Bearer $SENDOKA_API_KEY"

2. Fetch the original message (for the body)

curl https://api.sendoka.com/api/v1/messages/msg_01HN... \
  -H "Authorization: Bearer $SENDOKA_API_KEY"

3. Send again — use a fresh idempotency key

import crypto from "node:crypto";

const API = "https://api.sendoka.com/api/v1";
const headers = {
  Authorization: `Bearer ${process.env.SENDOKA_API_KEY}`,
  "Content-Type": "application/json",
};

const original = await fetch(`${API}/messages/msg_01HN...`, { headers }).then((r) => r.json());

await fetch(`${API}/emails`, {
  method: "POST",
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID() },
  body: JSON.stringify({
    from: original.from_email,
    to: [original.to_email],
    subject: original.subject,
    html: original.html_body,
  }),
});

Gotchas

  • Hard bounces (invalid address, domain NXDOMAIN) stay suppressed for a reason. Don't just remove and retry — fix the address first.
  • Complaints should never be un-suppressed automatically. That's a legal issue (CAN-SPAM / GDPR).
  • Sendoka's auto-suppression from bounces is org-wide (+ tenant-scoped in platform mode). Scoping is not per-key.