Skip to main content
Transactional emails are one-to-one messages automatically triggered by user actions — for example, password resets, verification codes, order confirmations, and system alerts. With thePurplebox, sending these emails is fast, secure, and only takes a single API request.

Prerequisites

  • A thePurplebox account
  • A secret API key generated from your dashboard
  • A verified sending domain (recommended for best deliverability)

Sending an email

Sending a transactional email requires one API call with three basic parameters:
  • to: A single email address or an array of recipients
  • subject: The email subject line
  • body: The message content (plain text or HTML)
  • JavaScript
  • Go
  • Python
  • PHP
  • Java
  • Rust
  • Ruby
  • C#
  • ASP.NET
  • cURL
await fetch('https://api.thepurplebox.io/v1/send', {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "Authorization": "Bearer <API_KEY>"
  },
  body: JSON.stringify({
    to: "[email protected]",
    subject: "Welcome to thePurplebox!",
    body: "<h1>Your account is ready!</h1>"
  })
})