Skip to content

Quickstart

This guide walks you through sending your first email with the RelayPost REST API.

  • A RelayPost account — sign up free
  • A domain you control (for production sending)

After signing up, you’ll be prompted to create an organization. This is your workspace — all API keys, domains, and emails are scoped to it.

Go to Settings → API Keys and create a new key. Copy it immediately — it’s only shown once.

Your key looks like: rp_live_aBcDeFgHiJkLmNoPqRsT...

Terminal window
curl -X POST https://api.relaypost.dev/v1/emails/send \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"from": { "email": "hello@yourdomain.com", "name": "Your App" },
"to": [{ "email": "test@example.com" }],
"subject": "Hello from RelayPost",
"html": "<h1>It works!</h1><p>Your email delivery is set up.</p>"
}'

A successful send returns:

{
"data": {
"message_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "queued",
"queued_at": "2025-01-15T10:30:00.000Z"
}
}

How long does it take to set up RelayPost?

Section titled “How long does it take to set up RelayPost?”

You can send your first email in under 5 minutes. Sign up, create an organization, generate an API key, and make a single API call. For production sending, domain verification takes an additional 5–30 minutes for DNS propagation.

What programming languages does RelayPost support?

Section titled “What programming languages does RelayPost support?”

RelayPost works with any language that can make HTTP requests. The REST API accepts JSON over HTTPS. The SMTP relay works with any SMTP client. Documentation includes examples for JavaScript, Python, Ruby, PHP, and cURL.

Do I need to verify my domain before sending?

Section titled “Do I need to verify my domain before sending?”

Domain verification is not required for testing, but it is strongly recommended for production. Verified domains have SPF and DKIM authentication, which significantly improves inbox placement and prevents your emails from landing in spam.