Webhooks

Subscribe to a portal or a single run, and Rover posts that run's events to your URL when it finishes. Every post is signed with a secret only you and Rover hold.

Subscribe

POST /v1/subscriptions with either portal (every run on that portal) or runId (one run), a subscriber, and a webhook channel. The quickstart has a full example.

  • subscriber.tenantId must be your own team. subscriber.userId is your label for who the events are for, and comes back on every delivery.
  • The URL must be HTTPS and resolve to a public address.
  • The answer includes secret, generated by Rover. It is shown once. Store it where your receiver can read it.
  • A run subscription ends once its run's events are delivered. A portal subscription lasts until you call DELETE /v1/subscriptions/{id}.

What Rover sends

After a run finishes, Rover posts each of its events in order, one request per event. The last one also carries result, the run's outcome.

POST https://your-app.example.com/rover (trimmed)
content-type: application/json
x-rover-signature: sha256=5c1e0f4b9a...
x-rover-timestamp: 1790294400
x-rover-subscription: 0d9f5c2e-8a41-4b7e-a6d3-1c2b3a4d5e6f
x-rover-sequence: 14

{
  "subscriptionId": "0d9f5c2e-8a41-4b7e-a6d3-1c2b3a4d5e6f",
  "subscriber": { "userId": "ap-team", "tenantId": "your-team" },
  "runId": "run-5f2a9c",
  "portal": "https://portal.example-hauler.test/login",
  "seq": 14,
  "event": { "kind": "done", "at": "2026-09-24T06:12:41.000Z", "exit": 0, "totals": { "records": 38 } },
  "result": { "runId": "run-5f2a9c", "disposition": "succeeded", "exit": 0 }
}

Event types

Every event has kind, at, runId and portal. These are the ones most receivers act on:

Events
kindMeans
snapshot_storedA reading was stored. Counts of records, duplicates and documents. Fetch the rows with the record reads.
changes_detectedWhat moved since the previous reading: added, removed and changed counts, and the notable changes with each field's before and after.
doneThe run ended normally. Carries exit and totals.
failedThe run failed. Carries a code and a reason.
heldThe run needs a person. Carries a reason and a nextStep.
blockedThe portal showed something Rover could not get past, such as a challenge page. Carries blockKind.
cancelledSomeone stopped the run.

Other kinds report a run's progress. Ignore any kind you don't handle, since Rover adds new ones. result.disposition is one of succeeded, completed_empty, held, blocked, failed, cancelled, transient or permanent.

Verify the signature

x-rover-signature is sha256= followed by the hex HMAC-SHA256 of <x-rover-timestamp>.<raw body>, keyed with your secret. The timestamp is Unix seconds and is inside the signature, so a copied request cannot be replayed later with a new one. Rover signs each attempt fresh.

  1. Read the raw body before parsing it. Re-serialized JSON will not match.
  2. Reject a timestamp more than five minutes from your clock.
  3. Compute the HMAC and compare in constant time.
receiver.mjs
import { createHmac, timingSafeEqual } from 'node:crypto';
import express from 'express';

const secret = process.env.ROVER_WEBHOOK_SECRET;
const app = express();

app.post('/rover', express.raw({ type: 'application/json' }), (req, res) => {
  const timestamp = Number(req.get('x-rover-timestamp'));
  const signature = req.get('x-rover-signature') ?? '';
  const body = req.body.toString('utf8');

  if (!Number.isFinite(timestamp) || Math.abs(Date.now() / 1000 - timestamp) > 300) {
    return res.sendStatus(400);
  }
  const expected = 'sha256=' + createHmac('sha256', secret)
    .update(`${timestamp}.${body}`)
    .digest('hex');
  const given = Buffer.from(signature);
  const wanted = Buffer.from(expected);
  if (given.length !== wanted.length || !timingSafeEqual(given, wanted)) {
    return res.sendStatus(401);
  }

  const delivery = JSON.parse(body);
  // Deliveries can repeat. Skip one you have already seen by subscriptionId and seq.
  handle(delivery);
  res.sendStatus(204);
});

app.listen(3000);

Retries

  • Answer with any 2xx within five seconds. Anything else counts as a miss.
  • Rover tries each event up to four times, with a short wait between tries.
  • Delivery is at least once and in order. If an event still fails, Rover stops there and resumes from that event later, after the next run on the portal or when its workers restart. You never get an event before the one ahead of it.
  • After five failed deliveries in a row, Rover ends the subscription. Create a new one to resume.