Documentation

Relaya docs

Everything you need to route a provider's webhooks through Relaya, forward them to your code, test them, and recover when something breaks. Plus sending webhooks to your own customers, and working with your users' accounts at other apps.

Quick start

  1. Sign up and create a project, then a webhook. Pick the provider (Razorpay, Cashfree, PayU, PhonePe, Stripe, Shopify, GitHub, Jira, Slack, Twilio, HubSpot, Square, Segment, SendGrid, Notion, Standard Webhooks / Svix (which also covers senders built on Svix, such as Brex, Clerk and Resend), or generic HMAC) and paste its signing secret, so Relaya can verify what arrives. The webhook's page shows where to set this up at the provider.
  2. Give the provider your webhook's URL instead of your own endpoint:
    Webhook URL
    https://api.relaya.sbs/v1/in/<your webhook token>
    Every event is stored, checked and shown in Events within milliseconds.
  3. Add a destination: your endpoint's public HTTPS URL. Relaya forwards each accepted event there, with retries. Copy the signing secret it shows once. A destination can take every event type or only some (e.g. just payment.captured).
  4. In your endpoint, verify Relaya's signature (below) and answer 2xx once you've handled the event.
  5. Try it without a real payment: Send a test event on the webhook's page, or the CLI to receive events on your own computer.
  6. Optional: after 20 events of a type (or a day), Relaya proposes a contract. Mark the fields you depend on as critical and activate it; from then on, breaking changes open an incident and alert you.

Receive events

Relaya sends a POST with the provider's original body and Content-Type, the provider's own headers (so existing checks keep working), and these:

HeaderMeaning
Relaya-SignatureProves the request came from Relaya (see below).
Idempotency-KeyThe same on every retry and replay of one delivery. Dedupe on this.
Relaya-Event-IdThe event's ID, to look it up in the dashboard or API.
Relaya-Delivery-IdThis delivery's ID.
Relaya-Attempt1 on the first try, then 2, 3… on retries.
Relaya-Event-TypeFor example payment.captured, when Relaya could tell.
Relaya-ReplaySet when the request is part of an incident replay.
Relaya-RepairedSet when repair rules changed the body (the provider's own signature headers are then left out).
Relaya-SimulatedSet on test events from the event simulator or relaya trigger.

The signature

Relaya-Signature
Relaya-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256(secret, "<t>.<raw body>")>

Compute the HMAC over the exact bytes you received (not re-serialised JSON), compare in constant time, and reject timestamps more than 5 minutes from now. The SDKs below do all of this in one line.

Any language: check it by hand
t=1790380800
body='{"type":"payment.captured","amount":100}'
printf '%s.%s' "$t" "$body" | openssl dgst -sha256 -hmac "$RELAYA_SIGNING_SECRET"
# must equal the v1= value

SDKs

Each SDK verifies deliveries and wraps the REST API. Source and full READMEs: github.com/relayaa/relaya-sdks.

Install
npm install relaya-node
Verify and handle deliveries
import express from 'express'
import { relayaMiddleware } from 'relaya-node'

const app = express()
// Mount before express.json(): the signature needs the raw body.
app.post('/webhooks/relaya', relayaMiddleware({ secret: process.env.RELAYA_SIGNING_SECRET }), async (req, res) => {
  const delivery = req.relaya
  if (await alreadyProcessed(delivery.idempotencyKey)) return res.sendStatus(200)
  await handle(delivery.json())
  res.sendStatus(200)
})

Every SDK (Node.js, Python, PHP, Go, Java) also covers sending webhooks to your customers and your users' accounts.

Test events and the CLI

Event simulator

On a webhook's page, Send a test event picks a sample for its provider (Razorpay payment.captured, Stripe payment_intent.succeeded, Shopify orders/create, GitHub push, Jira jira:issue_created…), lets you edit it, and sends it. Relaya signs it with the webhook's own secret exactly the way the provider does, so it goes through everything a real event does: signature check, duplicate detection, your destinations and retries. Test events are labelled simulated in Events and never teach contracts.

The CLI: events on your own computer

While you build, forward the events a webhook receives to your laptop, like the Stripe CLI. It connects out to Relaya, so it works behind any firewall or home network, and catches up on anything missed if the connection drops.

Terminal
relaya login                        # paste an admin API key (it isn't shown)
relaya listen --forward-to http://localhost:3000/webhooks
relaya trigger payment.captured     # in another terminal: a signed test event
What you see
11:15:19  Ready. Waiting for events…
11:15:22  payment.captured (simulated)  6b20d442  → ✓ 200 OK (27 ms)
11:15:40  payment.failed  03867e95  → ✗ 500 Internal Server Error (4 ms)

Your local server gets the provider's original body and headers (so your own Razorpay or Stripe signature check keeps working) plus Relaya's headers, signed with a secret the CLI prints; it stays the same across runs, so keep it in your local .env. Options: --webhook (ID or name), --events a,b, -H "Name: value", --print-body.

Download it for Windows, macOS or Linux from the latest release, or with Go: go install github.com/relayaa/relaya-sdks/cli/cmd/relaya@latest.

Retries and idempotency

  • Success is any 2xx. Answer quickly and do slow work afterwards; the timeout is 10 seconds by default.
  • Retried: 408, 429, 5xx, timeouts and network errors, after 30s, 2m, 10m, 30m, 1h, 3h and 6h (±20%), up to 8 attempts. A Retry-After header is honoured.
  • Not retried: other 4xx and redirects (redirects are never followed: use the final URL).
  • Because of retries and replays, the same event can arrive more than once. Store the Idempotency-Key and ignore repeats.
  • Destinations must be public HTTPS URLs; private and internal addresses are refused.

Contracts and incidents

Relaya learns the shape of each event type: which fields exist, their types, which are always present, and small sets of values (like a status). When you activate a contract, every event is checked against it:

ResultMeaning
matchesFits the contract.
new fieldsThe provider added fields. Nothing breaks.
warningA non-critical field changed type, went missing or has a new value.
breakingA critical field is missing, null or changed type. Opens an incident.
repairedIt broke the contract, but a repair rule fixed it before forwarding. No incident.

An incident groups every event with the same broken field. It resolves when you resolve it, when you accept the change into a new contract version, after an hour with no new occurrences once a later event matches, or when a replay is fully delivered.

Repair rules and replay

A repair rule edits the payload before it is forwarded, so your endpoint keeps working while the provider fixes their side. The stored event is never changed. Changes: convert a type ("100" → 100), rename a field, fill in a missing value, replace values, set or remove a field. Paths use dots, and [] for every item of a list: items[].price.

On an incident, Fix with a rule suggests the change and lets you preview it on the incident's own event. Then Replay resends the affected events (repaired, with their original idempotency keys); when every one is accepted, the incident resolves itself.

Alerts

In Settings → Alerts, send alerts to Slack (an incoming webhook), a teammate's email, Jira, or your own endpoint (signed like deliveries). Choose which: incident opened or resolved, a destination failing (3 failures in a row) or recovered, signature failures, a connection broken or recovered, and a sync failing or recovered. You get one alert per problem, not one per event.

Jira: enter your Jira site, your Atlassian email, an API token, a project key and an issue type; Relaya checks them with Jira when you save. Each problem opens one issue labelled relaya. If it happens again while the issue is open, Relaya adds a comment; when it's fixed, Relaya comments and moves the issue to Done. The alert log links every alert to its issue.

Send webhooks to your customers

If your product sends webhooks to its own customers, Relaya can do the sending: one API call per event, and Relaya signs it with Standard Webhooks, retries failures for up to a day and logs every attempt.

  1. Create an app for each customer, keyed by your own ID for them (POST /outbound/apps, or Outbound in the dashboard).
  2. Whenever something happens, send a message. With an idempotency_key, sending the same message twice sends it once.
  3. Give each customer a portal link (valid 24 hours) where they add their endpoints, choose event types, see every delivery and re-send failures. Or manage endpoints for them through the API.
Send an event
curl -X POST https://api.relaya.sbs/v1/orgs/<org id>/outbound/messages \
  -H "Authorization: Bearer rk_..." -H "Content-Type: application/json" \
  -d '{"app":"customer-123","event_type":"invoice.paid","payload":{"invoice_id":"in_1","amount":1999},"idempotency_key":"in_1-paid"}'

Your customers verify each request with any Standard Webhooks library, using the endpoint's whsec_… secret and the webhook-id, webhook-timestamp and webhook-signature headers. webhook-id stays the same on retries, so it's what they dedupe on.

Your users' accounts: connect, call, sync

Let your users connect their Zoho, HubSpot, Google, Jira or Shiprocket accounts. Relaya runs the sign-in, stores their tokens encrypted and keeps them fresh. Add your OAuth app once in Connections (the page shows each provider's setup steps and callback URL), then:

  1. Connect: your backend creates a one-time link for a user (POST /connect-sessions); open it in a popup with connect.js or redirect them.
  2. Call: send API calls through Relaya's proxy (/connections/{id}/proxy/<provider path>). Relaya adds and renews the user's token and retries what is safe to retry. The provider's own answers come back as they are; errors from Relaya itself carry Relaya-Proxy-Error: true.
  3. Sync: new and changed records become events on a schedule, delivered like any webhook, e.g. zoho.lead.created, hubspot.contact.updated, google.sheet_row.created, shiprocket.order.updated or jira.issue.created (optionally only some projects or a JQL filter). This also works for apps that don't send webhooks.
Call Zoho as one of your users (Node.js)
const conn = await relaya.connections.find('zoho', user.id)
const res = await relaya.proxy(conn.id).get('/crm/v2/Leads', { query: { per_page: 10 } })
if (res.ok) console.log(res.data)

Jira connections use Atlassian OAuth: after the user approves, Relaya finds their Jira site and calls it through api.atlassian.com. A connection breaks when the user revokes access; you get a connection broken alert and send them a new link.

REST API

Base URL https://api.relaya.sbs/v1. Create an API key in Settings → API keys (member keys read, admin keys can change things) and send it as a bearer token:

curl
curl https://api.relaya.sbs/v1/orgs/<org id>/events?contract_status=breaking \
  -H "Authorization: Bearer rk_..."

Errors look like {"error": {"code": "not_found", "message": "..."}}. Lists return {"data": [...]}; events also return next_cursor: pass it back as cursor for the next page. Get your org ID from GET /v1/me.

ResourceEndpoints (under /v1/orgs/{org})
ProjectsGET/POST /projects, GET/DELETE /projects/{id}
WebhooksGET/POST /webhooks, GET/PATCH/DELETE /webhooks/{id}, POST …/rotate-url
Test eventsGET /webhooks/{id}/samples, POST /webhooks/{id}/simulate (admin)
EventsGET /events (filters: webhook_id, type, status, contract_status, since, until), GET /events/{id}, GET …/raw (unmasked, admin)
DestinationsGET/POST /webhooks/{id}/destinations, PATCH/DELETE /destinations/{id}, POST …/test, POST …/rotate-secret (event_types limits which types it takes)
DeliveriesGET /deliveries, GET /deliveries/{id}, POST /deliveries/{id}/retry
ContractsGET /contracts, GET /contracts/{id}, POST …/versions, POST …/relearn
IncidentsGET /incidents, POST …/resolve, GET/POST …/replay, GET …/repair-suggestion
Repair rulesGET/POST /repair-rules, PATCH/DELETE /repair-rules/{id}, POST /repair-rules/preview
AlertsGET/POST /alert-channels (Slack, email, webhook, Jira), PATCH/DELETE /alert-channels/{id}, POST …/test, GET /alerts
OutboundPOST /outbound/messages, GET/POST /outbound/apps, GET/DELETE /outbound/apps/{app}, POST …/portal-link, …/endpoints, GET/POST/DELETE /outbound/event-types
ConnectionsGET/POST /integrations, POST /connect-sessions, GET /connections, GET …/token, POST …/refresh, …/connections/{id}/proxy/<path>, GET /proxy-calls
SyncsGET/POST /syncs, PATCH/DELETE /syncs/{id}, POST …/run, GET …/runs; models at GET /v1/connect/sync-models
TeamGET/POST /members, GET/POST/DELETE /api-keys, GET /audit-logs

Limits

WhatLimit
Event body5 MB
Events per webhook URL100 a second, bursts of 1,000 (over it: 429 with Retry-After; providers retry)
API requests600 a minute per user or API key
Sign-in10 failed attempts per account per 15 minutes
Event payloads kept30 days (incidents, contracts and the audit log are kept)

Something not covered here? See security and system status.