PINGRAILS DEVELOPER REFERENCE · V1 API
Ping-Post API & Signed Webhooks
Integrate sub-80ms real-time auctions and constant-time HMAC-SHA256 outbound CRM webhooks with 7-attempt exponential retries and 1-click DLQ replay.
Ping, Post & Direct Endpoints
/api/v1/ingest/pingAuthorization: Bearer pub_live_<token>Step 1 of 2-phase RTB: submit anonymized lead attributes (zero PII). Returns the clearing bid and a 120-second pingId.
{
"vertical": "INSURANCE",
"serviceCode": "AUTO",
"stateCode": "TX",
"zipCode": "78701",
"attributes": {
"ownership": "own",
"applicantAge": 34,
"currentCarrier": "GEICO",
"multiVehicle": true
}
}{
"status": "ACCEPTED",
"pingId": "png_01j9a2k8f3d1",
"clearingMode": "EXCLUSIVE",
"bidCents": 2850,
"buyerCount": 1,
"expiresInSeconds": 120
}Verifying X-PingRails-Signature
Every outbound lead webhook sent to your CRM includes an X-PingRails-Signature: t=<unix_ts>,v1=<hmac_sha256_hex> header signed over the exact string <t>.<rawBody> using your endpoint's secret. Reject any request older than ±300 seconds and compare digests in constant time.
import { createHmac, timingSafeEqual } from 'node:crypto';
export function verifyPingRailsSignature(
rawBody: string,
signatureHeader: string,
signingSecret: string,
toleranceSeconds = 300,
): boolean {
const parts = Object.fromEntries(
signatureHeader.split(',').map((kv) => kv.trim().split('=')),
);
const timestamp = Number.parseInt(parts.t ?? '', 10);
const receivedV1 = parts.v1 ?? '';
if (!Number.isFinite(timestamp) || !/^[a-f0-9]{64}$/i.test(receivedV1)) {
return false;
}
// Enforce ±5 minute replay protection window
const nowSeconds = Math.floor(Date.now() / 1000);
if (Math.abs(nowSeconds - timestamp) > toleranceSeconds) {
return false;
}
const expectedHex = createHmac('sha256', signingSecret)
.update(`${timestamp}.${rawBody}`, 'utf8')
.digest('hex');
return timingSafeEqual(
Buffer.from(expectedHex, 'hex'),
Buffer.from(receivedV1.toLowerCase(), 'hex'),
);
}Live HMAC-SHA256 Signature Verifier
Test your webhook secret, raw JSON payload, and X-PingRails-Signature header locally in your browser via SubtleCrypto. Try editing one byte of the payload and re-verifying to see tamper detection fire immediately.
1796253002.<329 UTF-8 bytes>—Delivery Retry Schedule & Dead-Letter Queue (DLQ)
Any non-2xx HTTP status or timeout (>10s) retries automatically across 7 exponential windows before archiving to DLQ for 1-click replay.
| Attempt | Backoff Delay | Cumulative Window | Behavior |
|---|---|---|---|
| Attempt 1 | 0ms (Immediate) | T + 0s | Initial real-time delivery post-COMMIT |
| Attempt 2 | +5 seconds | T + 5s | Transient network / 5xx retry |
| Attempt 3 | +30 seconds | T + 35s | CRM cold-start / burst retry |
| Attempt 4 | +2 minutes | T + 2m 35s | Short downstream deploy window |
| Attempt 5 | +10 minutes | T + 12m 35s | Extended outage backoff |
| Attempt 6 | +30 minutes | T + 42m 35s | Extended outage backoff |
| Attempt 7 | +2 hours | T + 2h 42m | Final automatic retry before DLQ |
| Dead-Letter Queue | Manual Replay | Archived | 1-click replay in /integrations portal (no re-charge) |
Inbound CRM Disposition Sync (POST /api/v1/webhooks/inbound/[slug])
Push lead lifecycle updates (OPEN, CONTACTED, QUOTED, BOUND, DISPUTED) and closed revenue cents back from AgencyZoom, EZLynx, ServiceTitan, Jobber, HubSpot, or Salesforce to automatically update your PingRails Kanban board and ROI attribution.