← Back to API Reference Hub

Webhooks API Reference

Subscribe to real-time inventory and domain lifecycle events over HTTPS. Every delivery is signed with HMAC-SHA256 and retried automatically with exponential backoff for up to 24 hours.

Webhook Subscriptions & Deliveries - subscribe, verify signatures & inspect delivery logs.

Manage webhook endpoints, send synthetic test events, and query delivery logs.

MethodEndpointPurpose
GET/api/webhooksList all configured webhook subscriptions and the full list of supported event types.
POST/api/webhooksRegister an HTTPS endpoint to receive real-time HMAC-signed event deliveries; returns the signing secret once on creation.
GET/api/webhooks/{id}Retrieve a webhook subscription's configuration and recent delivery attempts.
PUT/api/webhooks/{id}Update the target URL, subscribed event list, description, or active state of a webhook.
DELETE/api/webhooks/{id}Delete a webhook subscription and stop all future event deliveries.
POST/api/webhooks/{id}/testQueue a signed synthetic test event to verify that your endpoint validates the HMAC signature and returns 2xx.
GET/api/webhooks/{id}/deliveriesReturn a paginated log of webhook deliveries, HTTP status codes, and retry state.

Webhook event types

Subscribe to any combination of the events below when creating or updating a webhook via POST /api/webhooks. Webhook deliveries do not count toward your hourly API rate limit.

EventFires when
domain.ingestedInitial onboarding and first full inventory scrape complete for a newly added dealer domain
domain.scrape_completedA scheduled or manual domain scrape job finishes
domain.scrape_failedA domain scrape job encounters an error
vehicle.addedA new VIN appears in active inventory at a tracked domain
vehicle.updatedAny field on an existing vehicle listing changes
vehicle.price_changedA vehicle's listed price moves up or down (payload includes old and new price)
vehicle.removedA VIN is delisted from a tracked dealer website
alert.competitor_new_inventoryA competitor in a tracked group adds matching inventory
alert.competitor_price_changeA competitor changes price on a comparable vehicle
vla.boost_triggeredA reactive bid boost multiplier activates for a VIN in a VLA feed

HMAC-SHA256 signature verification

When you create a webhook via POST /api/webhooks, the response includes a signing secret returned once. Every webhook HTTP POST delivery carries these headers:

DELIVERY HEADERS
X-MotorsDynamic-Event: vehicle.price_changed
X-MotorsDynamic-Timestamp: 1735689600
X-MotorsDynamic-Signature: sha256=8f4e2b9a...

Compute HMAC-SHA256(secret, "<X-MotorsDynamic-Timestamp>.<raw_body>") and compare in constant time against X-MotorsDynamic-Signature. Reject deliveries whose timestamp is more than 5 minutes old. Non-2xx responses are retried automatically with exponential backoff for up to 24 hours.

NODE.JSSignature verification
import crypto from 'crypto';

function verifyWebhook(secret, timestamp, rawBody, signature) {
  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
  const expected = 'sha256=' + crypto
    .createHmac('sha256', secret)
    .update(`${timestamp}.${rawBody}`)
    .digest('hex');
  return expected.length === signature.length &&
    crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
}

List webhook subscriptions

GET/api/webhooks

List all configured webhook subscriptions and the full list of supported event types.

NameTypeRequiredDescription
None--No parameters required
CURLGET /api/webhooks
curl -sS "https://api.motorsdynamic.com/api/webhooks" \
  -H "X-API-Key: YOUR_API_KEY"
RESPONSE200 OK
{
  "webhooks": [
    {
      "id": 14,
      "dealer_id": 42,
      "agency_id": 3,
      "url": "https://example.com/webhooks/motorsdynamic",
      "events": ["domain.ingested", "vehicle.added", "vehicle.price_changed", "vehicle.removed"],
      "is_active": true,
      "description": "Primary inventory sync",
      "created_at": "2026-10-01T12:00:00.000Z"
    }
  ],
  "supported_events": [
    "domain.ingested",
    "domain.scrape_completed",
    "domain.scrape_failed",
    "vehicle.added",
    "vehicle.updated",
    "vehicle.price_changed",
    "vehicle.removed",
    "alert.competitor_new_inventory",
    "alert.competitor_price_change",
    "vla.boost_triggered"
  ]
}

Create a webhook subscription

POST/api/webhooks

Register an HTTPS endpoint to receive real-time HMAC-signed event deliveries; returns the signing secret once on creation.

NameTypeRequiredDescription
dealer_idinteger (body)YesNumeric dealer or domain identifier
urlstring (body)YesTarget URL (dealer website URL or HTTPS webhook receiver URL)
eventsstring[] (body)YesArray of webhook event names to subscribe to
descriptionstring (body)NoOptional human-readable description
CURLPOST /api/webhooks
curl -sS -X POST "https://api.motorsdynamic.com/api/webhooks" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"dealer_id": 42, "url": "https://example.com/webhooks/motorsdynamic", "events": ["domain.ingested", "vehicle.added", "vehicle.price_changed", "vehicle.removed"], "description": "Primary inventory sync"}'
RESPONSE201 Created
{
  "webhook": {
    "id": 14,
    "dealer_id": 42,
    "url": "https://example.com/webhooks/motorsdynamic",
    "events": ["domain.ingested", "vehicle.added", "vehicle.price_changed", "vehicle.removed"],
    "secret": "whsec_4f8b9d2e1a7c6b5f3e2d1c0b9a8f7e6d",
    "is_active": true
  }
}

Get webhook detail and recent deliveries

GET/api/webhooks/{id}

Retrieve a webhook subscription's configuration and recent delivery attempts.

NameTypeRequiredDescription
idinteger (path)YesNumeric resource identifier
CURLGET /api/webhooks/{id}
curl -sS "https://api.motorsdynamic.com/api/webhooks/14" \
  -H "X-API-Key: YOUR_API_KEY"
RESPONSE200 OK
{
  "webhook": {
    "id": 14,
    "dealer_id": 42,
    "url": "https://example.com/webhooks/motorsdynamic",
    "events": ["domain.ingested", "vehicle.added", "vehicle.price_changed", "vehicle.removed"],
    "is_active": true
  },
  "recent_deliveries": [
    { "id": 8910, "event": "vehicle.price_changed", "status": "delivered", "response_code": 200 }
  ]
}

Update a webhook subscription

PUT/api/webhooks/{id}

Update the target URL, subscribed event list, description, or active state of a webhook.

NameTypeRequiredDescription
idinteger (path)YesNumeric resource identifier
urlstring (body)NoUpdated HTTPS webhook endpoint URL
eventsstring[] (body)NoUpdated array of subscribed event types
is_activeboolean (body)NoEnable or pause deliveries
descriptionstring (body)NoUpdated description
CURLPUT /api/webhooks/{id}
curl -sS -X PUT "https://api.motorsdynamic.com/api/webhooks/14" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"events": ["vehicle.added", "vehicle.price_changed", "vehicle.removed"], "is_active": true}'
RESPONSE200 OK
{
  "webhook": {
    "id": 14,
    "events": ["vehicle.added", "vehicle.price_changed", "vehicle.removed"],
    "is_active": true
  }
}

Delete a webhook subscription

DELETE/api/webhooks/{id}

Delete a webhook subscription and stop all future event deliveries.

NameTypeRequiredDescription
idinteger (path)YesNumeric resource identifier
CURLDELETE /api/webhooks/{id}
curl -sS -X DELETE "https://api.motorsdynamic.com/api/webhooks/14" \
  -H "X-API-Key: YOUR_API_KEY"
RESPONSE200 OK
{
  "message": "Webhook deleted",
  "id": 14
}

Send a test webhook delivery

POST/api/webhooks/{id}/test

Queue a signed synthetic test event to verify that your endpoint validates the HMAC signature and returns 2xx.

NameTypeRequiredDescription
idinteger (path)YesNumeric resource identifier
CURLPOST /api/webhooks/{id}/test
curl -sS -X POST "https://api.motorsdynamic.com/api/webhooks/14/test" \
  -H "X-API-Key: YOUR_API_KEY"
RESPONSE200 OK
{
  "message": "Test delivery queued",
  "delivery_id": 8911
}

List webhook delivery history

GET/api/webhooks/{id}/deliveries

Return a paginated log of webhook deliveries, HTTP status codes, and retry state.

NameTypeRequiredDescription
idinteger (path)YesNumeric resource identifier
pageinteger (query)No1-based page number for paginated responses
limitinteger (query)NoMaximum number of results to return per page
statusstring (query)Nopending | delivered | failed
CURLGET /api/webhooks/{id}/deliveries
curl -sS "https://api.motorsdynamic.com/api/webhooks/14/deliveries?status=delivered&page=1&limit=25" \
  -H "X-API-Key: YOUR_API_KEY"
RESPONSE200 OK
{
  "deliveries": [
    {
      "id": 8910,
      "event": "vehicle.price_changed",
      "status": "delivered",
      "response_code": 200,
      "attempts": 1,
      "delivered_at": "2026-10-30T06:14:02.000Z"
    }
  ],
  "pagination": { "total": 148, "page": 1, "limit": 25, "pages": 6 }
}