Relay Quick Start

Schedule a webhook and verify its delivery in minutes.

Prerequisites

Get an API key from solenoid.systems/pricing. Keys are prefixed with sm_. If you already have a Solenoid API key, it works for Relay too.

Base URL

https://api.solenoid.systems

All endpoints require a Bearer token. See Authentication.

Schedule a webhook

curl:

curl -X POST https://api.solenoid.systems/v1/relay \
  -H "Authorization: Bearer sm_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "target_url": "https://your-app.com/webhooks",
    "method": "POST",
    "delay": "30s",
    "payload": {
      "event": "payment_success",
      "amount": 1999
    },
    "headers": {
      "X-Custom-Header": "value"
    }
  }'

JavaScript:

const response = await fetch('https://api.solenoid.systems/v1/relay', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer sm_your_api_key_here',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    target_url: 'https://your-app.com/webhooks',
    method: 'POST',
    delay: '30s',
    payload: { event: 'payment_success', amount: 1999 },
    headers: { 'X-Custom-Header': 'value' }
  })
})

const data = await response.json()
// data.relay_id       — unique webhook ID
// data.scheduled_for  — Unix timestamp (ms)
// data.status         — 'scheduled'

Response:

{
  "relay_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "scheduled_for": 1706123456789,
  "status": "scheduled"
}

Delay formats

  • 30s — 30 seconds
  • 5m — 5 minutes
  • 2h — 2 hours
  • 7d — 7 days

Maximum delay: 30 days. Minimum: 1 second.

Verify webhook signatures

When your endpoint receives a webhook, verify the HMAC-SHA256 signature.

import crypto from 'crypto'

function verifyWebhook(request, secret) {
  const signature = request.headers['x-solenoid-signature']
  const timestamp = request.headers['x-solenoid-timestamp']
  const payload = JSON.stringify(request.body)

  const expected = crypto
    .createHmac('sha256', secret)
    .update(timestamp + payload)
    .digest('hex')

  return signature === expected
}

The signing secret is your API key. Store it securely.

Next steps