How it works
How Relay works
From signup to production traffic with deterministic policies and proof artifacts.
1) Connect providers
Add Twilio/Telnyx credentials.
2) Define a policy
Primary → secondary order, retries, cooldown.
3) Send via API
One endpoint, idempotency supported.
4) Inspect the trace
Attempts, receipts, failovers, next steps.
curl (send a message)
curl -X POST https://api.apianlabs.com/v1/messages -H "x-api-key: $RELAY_API_KEY" -H "Content-Type: application/json" -d '{
"to": "+15551234567",
"from": "+15557654321",
"body": "Incident update: service restored.",
"segment": "transactional"
}'Safety rails
Relay starts in test mode with destination allowlisting and conservative limits. Complete go-live checks before enabling production traffic.
Proof artifacts
What Relay produces for every message
Relay is built for explainability: traces, receipts, and deterministic failover events you can export or stream via webhooks.
Trace timeline
A per-message timeline of attempts, receipts, and outcomes with correlation IDs.
Failover event log
A deterministic record of why failover occurred (timeouts/5xx/429) and what happened next.
Signed webhook events
Delivery + failover events you can ingest into incident tooling and analytics.
Trace timeline (sample)
queued
Message accepted and queued
attempt 1
Twilio started
retryable failure
timeout => retry
failover
primary -> secondary
delivered
receipt recorded
Receipt + webhook signing
Receipts capture provider response metadata, normalized status, and timestamps for audit.
{
"receipt": {
"provider": "telnyx",
"status": "delivered",
"providerMessageId": "abc_123",
"receivedAt": "2026-01-01T12:00:12Z"
}
}Webhooks include `x-apian-signature` and `x-apian-timestamp`. Verify signatures before processing events.
Signature verification guideBuild in minutes
Quickstart: connect a provider, create a routing policy, send a message, then inspect its trace timeline. Add a webhook endpoint to stream delivery + failover events into your systems.
POST /v1/messages
GET /v1/messages/{messageId}/trace