Tyche Labs data APIs
Docs menu: Webhooks

Webhooks

Create a watch with an HTTPS URL and we POST a signed JSON event when something changes. Respond with any 2xx status within 8 seconds.

Events

EventWhen
vehicle.mot_due, vehicle.tax_dueThe days remaining reach each of your daysBefore values (default 30, 7 and 1)
vehicle.mot_expired, vehicle.tax_expiredThe first daily check after expiry
vehicle.mot_test_recordedA new MOT test appears
company.status_changedCompanies House status changes
company.accounts_overdue, company.confirmation_statement_overdueA filing becomes overdue
company.risk_changedThe overall risk level changes
company.insolvency_noticeThe Gazette publishes a corporate insolvency notice for the company
company.filingCompanies House records a new filing
company.charge_created, company.charge_satisfiedA charge is registered or satisfied
company.insolvency_caseAn insolvency case is opened or updated
sanctions.match_added, sanctions.match_removedA monitored name gains or loses a potential match after a list update

Creating a watch

POST/v1/watches

Send one of registration, companyNumber or sanctions (a name to monitor) with a url. List with GET /v1/watches and remove with DELETE /v1/watches/{id}. Add many companies at once with POST /v1/watches/bulk.

curl https://api.tychelabs.net/v1/watches \
  -H "x-api-key: $TYCHE_API_KEY" \
  -H "content-type: application/json" \
  -d '{"registration":"AB12CDE","url":"https://example.com/hooks/tyche","daysBefore":[30,7,1]}'

Verifying signatures

The tyche-signature header is t=<unix time>,v1=<hex HMAC-SHA256 of "t.body"> using your webhook secret. Reject events older than five minutes. The verify tabs above show Node and Python.

Test events

POST /v1/watches/test-event with {"url": "https://…", "type": "company.insolvency_notice"} sends a signed sample, even with a sandbox key.

Email digests

Company and sanctions watches can also send a daily email digest to your account email: set "emailDigest": true when you create the watch. A digest only goes out on days with events.