API overview
The Apexsot API lets publishers sell calls and leads into our marketplace in real time. All endpoints accept and return JSON over HTTPS and are versioned under /v1.
Environments
New partners receive a sandbox key. Sandbox pings return realistic responses and test routing numbers that connect to an Apexsot test line — nothing reaches a real advertiser. Once your category mappings are verified, your key is promoted to live. The base URL is the same for both.
https://apexsot.com/api/v1Authentication
Send your secret key as a bearer token. Keys are scoped to one publisher account; create and revoke them under API & webhooks in your dashboard. Sandbox keys start with ak_test_, live keys with ak_live_. Limit: 100 requests per second per key.
Authorization: Bearer ak_live_••••••••••••••••Categories
Use these slugs in the category field:
plumbing · hvac · roofing · electrical · water-damage · pest-control · garage-door · locksmith · tree-service · remodeling · solar · movers · personal-injury · criminal-defense · family-law · bankruptcy · auto-insurance · debt-relief · medicare · senior-care
Webhook signatures
Every webhook carries an Apexsot-Signature header like t=1767225600,v1=5f2c…. Compute HMAC-SHA256 of `${t}.${rawBody}` with your signing secret and compare it to v1. Reject timestamps older than five minutes. Failed deliveries are retried with exponential backoff for about four hours.
import { createHmac, timingSafeEqual } from "node:crypto";
function verify(rawBody, header, secret) {
const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
return timingSafeEqual(Buffer.from(expected), Buffer.from(v1));
}Conventions
Phone numbers use E.164 (+18135550147). Money is in USD with two decimals. Every response includes a token you should store — it ties the ping to the eventual call or lead for reporting and reconciliation. Pass your own source_key to break reporting down by traffic source.