Relayloft docsSign in

Quick start

API base URL: https://api.relayloft.com

Relayloft speaks Resend's email API. If you already use a Resend SDK, point it at Relayloft and keep your code. The base URL for every API call is:

https://api.relayloft.com

1. Verify a sending domain

In the portal, open Domains and add the domain you'll send from (a subdomain such as mail.yourcompany.com is best). Publish the DNS records it shows; the page checks them live and the domain verifies itself, usually within minutes. The domain setup guide explains each record and has steps for the common DNS providers.

2. Create an API key

Under API keys, create a Sending only key for your app, optionally limited to that domain. It's shown once: store it as a secret.

3. Send an email

# .env
RESEND_API_KEY=mr_...
RESEND_BASE_URL=https://api.relayloft.com

Node (npm install resend):

import { Resend } from "resend";

const resend = new Resend(process.env.RESEND_API_KEY, { baseUrl: process.env.RESEND_BASE_URL });
const { data, error } = await resend.emails.send({
  from: "Acme <hello@mail.yourcompany.com>",
  to: ["delivered@simulator.relayloft.com"],
  subject: "Hello",
  html: "<p>It works</p>",
});

Python (pip install resend):

import os, resend

resend.api_key = os.environ["RESEND_API_KEY"]
resend.api_url = os.environ["RESEND_BASE_URL"]
resend.Emails.send({
    "from": "Acme <hello@mail.yourcompany.com>",
    "to": ["delivered@simulator.relayloft.com"],
    "subject": "Hello",
    "html": "<p>It works</p>",
})

cURL:

curl -X POST https://api.relayloft.com/emails \
  -H "Authorization: Bearer $RESEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"from":"Acme <hello@mail.yourcompany.com>","to":["delivered@simulator.relayloft.com"],"subject":"Hello","html":"<p>It works</p>"}'

delivered@simulator.relayloft.com is a test address: nothing is really sent, but you get the same events a real delivery would. See Sending.

4. Get events (optional)

Add a webhook endpoint under Webhooks to receive delivered, bounced and complained events. See Webhooks.

New accounts start in the sandbox

Until your account is approved, you can send only to people on your team and to the test addresses. Ask your Relayloft contact to approve the account when your domain is verified and your first tests look right.