v3 is here — see what changed→
Ship messages in minutes with the Relay API
One API for SMS, email and push. Guides, a full reference and SDKs for Node.js, Python, PHP and Go.
Popular: Authentication Webhooks Rate limits SDKs
POST /v3/messagescURLNode.jsPython
$ curl https://api.relay.example/v3/messages \
-H "Authorization: Bearer $RELAY_KEY" \
-H "Idempotency-Key: order-1042" \
-d channel=sms \
-d to=+15550100001 \
-d body="Your code is 482913"202 Accepted
{ "id": "msg_7Hq2kD", "status": "queued" }01 — Quickstart
From zero to first message
- 1. Get a test keyKeys start with rk_test_ and never send real messages.
- 2. Send a messageOne POST, three channels, automatic retries.
- 3. Listen for eventsDelivery webhooks with signed payloads.
- 4. Pick an SDKTyped clients with retries built in.
02 — Webhooks
Verify every event in five lines
Relay signs each webhook with HMAC-SHA256. Check the signature before you trust the payload.
Verify a webhook
import crypto from 'node:crypto';
// raw body + Relay-Signature header: t=1760371200,v1=5f2c…
const [t, v1] = header.split(',').map((p) => p.split('=')[1]);
const mac = crypto.createHmac('sha256', process.env.RELAY_WEBHOOK_SECRET)
.update(`${t}.${rawBody}`).digest('hex');
const ok = crypto.timingSafeEqual(Buffer.from(mac), Buffer.from(v1));import hmac, hashlib, os
# raw body + Relay-Signature header: t=1760371200,v1=5f2c…
t, v1 = [p.split('=')[1] for p in header.split(',')]
mac = hmac.new(os.environ['RELAY_WEBHOOK_SECRET'].encode(), f'{t}.{raw_body}'.encode(), hashlib.sha256).hexdigest()
ok = hmac.compare_digest(mac, v1)[$t, $v1] = array_map( fn( $p ) => explode( '=', $p )[1], explode( ',', $header ) );
$mac = hash_hmac( 'sha256', $t . '.' . $raw_body, getenv( 'RELAY_WEBHOOK_SECRET' ) );
$ok = hash_equals( $mac, $v1 );03 — Reference
Explore the docs
04 — Platform
Changelog & API status
New
API v3 is generally availableUnified channels, idempotency keys on every write and 40% faster delivery webhooks.
Security
Webhook signatures now use HMAC-SHA256New endpoints sign events with SHA-256. Existing endpoints can switch in Developers → Webhooks.
Improved
Python SDK 3.1 with async supportAn AsyncClient for asyncio apps, with the same methods as the regular client.