SPOTLIGHTDocs
APIStatusDashboard

Start

  • Overview
  • Getting started
  • Dashboard guide

Product

  • Profiles
  • Premium
  • Content creators
  • Widgets
  • Image host
  • Mobile app
  • Account & security

Creator Studio

  • Overview
  • Alerts
  • OBS widgets
  • Donate page
  • Payouts & fees

Discord bot

  • Overview
  • Commands
  • Web panel
  • Embeds & messages
  • Logging
  • Tickets & transcripts
  • Music
  • VoiceMaster
  • Applications & appeals
  • Linked Roles
  • RPG reference
  • Economy & levels
  • Moderation & safety
  • Server page & templates
  • Plans & billing

Developer API

  • Introduction
  • Game stats
  • Accounts & profiles
  • Webhooks
  • Public endpoints
  • API explorer & SDK

Help

  • Support

Developer API

Webhooks

Spotlight sends a signed POST to your server when something happens on your page. Set them up in Dashboard → API key → Webhooks (up to 3 URLs).

Events#

follower.neweventSomeone followed you
tip.receivedeventYou got a tip
sale.completedeventSomeone bought a download
member.joinedeventSomeone became a member
commission.requesteventA commission request came in
endorsement.neweventSomeone wrote you a recommendation
post.commenteventA comment on your status post
post.likeeventSomeone liked your status post
mentioneventSomeone mentioned you with @

Private messages and sign-in alerts are never sent to webhooks. A test button sends a test event.

The request#

Headers

Content-Typeapplication/jsonAlways JSON
User-AgentSpotlight-Webhooks/1.0Identifies Spotlight
X-Spotlight-EventstringThe event name, e.g. follower.new
X-Spotlight-Signaturet=<unix>,v1=<hex>HMAC-SHA256 signature, see below

Body

idstringUnique delivery id
eventstringEvent name
creatednumberUnix time in seconds
dataobjectEvent details, e.g. { "user": "username" } for who did it
follower.new
{
  "id": "9f2c4a1b7e3d5c60",
  "event": "follower.new",
  "created": 1731110400,
  "data": { "user": "froze" }
}

Verify the signature#

The signature is HMAC-SHA256(secret, "<t>.<raw body>") in hex. Compare it in constant time, and reject requests older than a few minutes so old ones can't be replayed. Use the raw body exactly as received.

import crypto from "node:crypto";

export function verify(rawBody, header, secret, maxAgeSec = 300) {
  const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  const t = Number(parts.t);
  if (!t || Math.abs(Date.now() / 1000 - t) > maxAgeSec) return false; // too old: maybe replayed
  const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  const a = Buffer.from(expected), b = Buffer.from(parts.v1 ?? "");
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

// Express: app.post("/hook", express.raw({ type: "application/json" }), (req, res) => {
//   if (!verify(req.body.toString(), req.get("X-Spotlight-Signature"), process.env.WHSEC)) return res.sendStatus(401);
//   const event = JSON.parse(req.body); res.sendStatus(200);
// });

Delivery rules#

  • HTTPS only, on the standard port, without a username or password in the URL.
  • Private, local and internal addresses are refused (for example localhost, 10.x, 192.168.x, cloud metadata addresses).
  • Redirects aren't followed. Answer within 5 seconds with any 2xx status.
  • Each event is sent once. The last 20 deliveries and their status codes show in the dashboard.

Your secret#

Each webhook has its own secret starting with whsec_, shown only once when you create it. Lost it? Delete the webhook and add it again.

Answer fast and do slow work afterwards (queue it). A webhook that keeps timing out still counts as delivered once, so nothing piles up.
← PreviousAccounts & profilesNext →Public endpoints