Developer surface

Send transactional email from a real domain.

The KasaPost API accepts product email through scoped API keys while keeping sender identity, logs, suppressions, and deliverability checks connected to the mailbox domain.

Endpoint

POST /api/v2/kasapost/send/

Authenticate with a KasaPost API key. The sender must belong to the API key domain. Use from_name or a formatted from value for display names. The static OpenAPI draft is available at /openapi.json.

curl https://mail.kasapost.com/api/v2/kasapost/send/ \
  -H "Authorization: Bearer kp_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "KasaPost ",
    "to": ["customer@example.com"],
    "subject": "Welcome to KasaPost",
    "text": "Your mailbox and sending lane are ready.",
    "html": "<p>Your mailbox and sending lane are ready.</p>"
  }'

Required

to, subject, and either text or html. If no sender is supplied, KasaPost uses the domain default.

Optional

from, from_email, from_name, cc, bcc, reply_to, and safe custom headers.

Response

Successful accepts return HTTP 202 with message ID, sender, recipient, subject, status, event, and log metadata.

Webhooks

Webhook endpoints can receive accepted, failed, suppressed, and related delivery events for product workflows.

Suppressions

Blocked recipients are checked before sending so known bad addresses do not keep hurting reputation.

Limits

Daily key limits and reputation policy protect new domains from sudden volume spikes.

Server-side usage

Keep API keys on your server.

Call KasaPost from backend routes, workers, or private server jobs only. Do not embed API keys in browser JavaScript, mobile apps, public repos, or logs.

// Server-side Node.js example only.
// Never expose KASAPOST_API_KEY to browser or mobile clients.
const response = await fetch('https://mail.kasapost.com/api/v2/kasapost/send/', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.KASAPOST_API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    from: 'KasaPost <hello@kasapost.com>',
    to: ['customer@example.com'],
    subject: 'Welcome to KasaPost',
    text: 'Your mailbox and sending lane are ready.'
  })
});

if (!response.ok) throw new Error(await response.text());