Developer Documentation

OpenMail API Docs

Professional relay API docs for transactional delivery integrations.

Endpoint

POST /r/[token]

Content Type

type: "text" | "html"

Required

to, subject, type, body

Request Schema

{
  "to": "user@example.com",
  "subject": "Welcome",
  "type": "html",
  "body": "<h1>Hello</h1>",
  "from_email": "no-reply@yourdomain.com",
  "from_name": "Your App",
  "metadata": { "event": "user_signup" }
}

Examples

curl -X POST https://openmail.openproject.co.zw/r/[token] \
  -H "Content-Type: application/json" \
  -d '{"to":"user@example.com","subject":"Hi","type":"text","body":"Hello"}'
await fetch("https://openmail.openproject.co.zw/r/[token]", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ to: "user@example.com", subject: "Hi", type: "html", body: "<p>Hello</p>" })
});
import requests
requests.post("https://openmail.openproject.co.zw/r/[token]", json={
    "to":"user@example.com","subject":"Hi","type":"text","body":"Hello"
})
payload := strings.NewReader(`{"to":"user@example.com","subject":"Hi","type":"text","body":"Hello"}`)
req, _ := http.NewRequest("POST", "https://openmail.openproject.co.zw/r/[token]", payload)

Python SDK

from openmail import OpenMailClient
client = OpenMailClient(api_key="your_api_key", token_url="https://openmail.openproject.co.zw/r/your_token")
client.send_email(to_email="user@example.com", subject="Welcome", type="html", body="<h1>Hello</h1>")

Node SDK (TypeScript)

import { OpenMailClient } from "openmail-node-sdk";
const client = new OpenMailClient({ apiKey: "your_api_key", tokenUrl: "https://openmail.openproject.co.zw/r/your_token" });
await client.sendEmail({ toEmail: "user@example.com", subject: "Welcome", type: "html", body: "<h1>Hello</h1>" });