Webhooks

Receive real-time notifications when events occur in your NexGeo.ai account.

Overview

Webhooks allow you to receive HTTP POST requests whenever specific events occur. This is useful for integrating NexGeo.ai with your own tools, dashboards, or automation workflows.

Available Events

EventDescription
scan.completedA scan has finished successfully
scan.failedA scan has failed
alert.triggeredOne or more alert rules matched
product.updatedA product's visibility score changed significantly

Setup

  1. Go to the Developers page in your dashboard
  2. Click Add Endpoint in the Webhooks section
  3. Enter your endpoint URL (must be HTTPS)
  4. Select which events to subscribe to
  5. Copy the signing secret — you'll need it to verify payloads

Payload Format

Webhook payloads are sent as JSON POST requests:

JSON
{
  "event": "scan.completed",
  "timestamp": "2025-01-15T10:35:00Z",
  "data": {
    "scan_id": "uuid",
    "store_id": "uuid",
    "products_scanned": 10,
    "avg_score": 68.4
  }
}

Verifying Signatures

Every webhook request includes an X-Webhook-Signature header containing an HMAC-SHA256 signature of the request body, signed with your webhook secret.

To verify:

TypeScript
import crypto from 'crypto';

function verifySignature(body: string, signature: string, secret: string): boolean {
  const expected = crypto
    .createHmac('sha256', secret)
    .update(body)
    .digest('hex');
  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}

Delivery & Retries

  • Webhooks are delivered within seconds of the triggering event
  • Your endpoint must respond with a 2xx status within 10 seconds
  • Failed deliveries are logged in the webhook delivery history
  • Delivery status is visible on the Developers page

Security: Always verify the webhook signature before processing the payload. Never trust the payload without signature verification.