Job webhooks (for workshop software)
A workshop adds an https address in Business tools. We post JSON to it when:
- job.matched: a new job it can reply to (job details, no customer details)
- job.connected: a driver connects with it (adds the customer's name, phone, email and address, as the workshop sees in the app)
- test: sent from the settings page
Every post carries an X-AutoRepairs-Signature header: sha256= and the HMAC-SHA256 of the exact body, keyed with the workshop's secret. Reply 2xx within 5 seconds.
POST https://your-system.example/autorepairs
Content-Type: application/json
X-AutoRepairs-Event: job.matched
X-AutoRepairs-Signature: sha256=<HMAC-SHA256 of the body, hex>
{"id":"…","event":"job.matched","created_at":"2026-10-22T09:15:00+13:00",
"data":{"job_id":"…","category":"Diagnostics & electrical",
"description":"Engine light on, car hesitates when accelerating",
"suburb":"Pakuranga","region":"East Auckland","urgency":"week","driveable":"yes",
"vehicle":{"year":2014,"make":"Mazda","model":"3"},"url":"https://autorepairs.nz/#leads"}}// Node.js: check a post came from AutoRepairs
const crypto = require('crypto');
const expected = 'sha256=' + crypto.createHmac('sha256', SECRET).update(rawBody).digest('hex');
const ok = crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(req.headers['x-autorepairs-signature'] || ''));