Government & Municipal
You built the 311 platform the city runs on. At 8:15 a resident reports a sinkhole, a statutory response clock starts, and the roads unit that can handle it is committed elsewhere.
You may never drive past that sinkhole — but your code decides whether the city meets its legal clock. Re-planning public-works crews against a statutory deadline is the code you don’t want to own. Your app flags the report priority: "p0" and starts the clock; Crisphive re-plans crews against unit skills, equipment, statutory windows and travel; your app confirms and updates the resident.
Try it in your language
Pick a scenario, switch the server SDK. Every snippet is the actual call the API reference generates — with municipal values filled in.
import { Configuration, JobRequestBusinessApi } from "@crisphive/sdk"; const config = new Configuration({ accessToken: "chsk_test_4eC8xQ9mZ2pL7Ka0rT" }); const api = new JobRequestBusinessApi(config); const res = await api.createJobRequest({ jobRequestCreateRequest: { "customer_id": "a1b2c3d4-0000-4a01-8c01-000000000001", "description": "Pothole patch — Elm Ave, routine", "job_dates": [ { "date": "2026-07-24", "periods": [ { "business_view": [], "period": "morning" } ] } ], "job_type_id": "b2c3d4e5-0000-4a02-8c02-000000000002", "priority": "p3", "skill_ids": [ "c3d4e5f6-0000-4a03-8c03-000000000003" ], "sla_deadline": "2026-07-31T17:00:00" }, }); const { error_code, message, data } = res.data;
Switch to Go, Ruby, PHP, Java or .NET — the class names, model types and method casing all follow that SDK’s generated conventions. Swap chsk_test_ for chsk_live_ and the same code runs against production.
▼Three ways this bites
These are the moments a 311/public-works platform is measured on — each a legal clock, a wasted roll, or a morning of triage. Every one maps to a field the API already carries.
The pain ·The week is rebuilt by hand to fit a hazard; if the legal clock quietly breaches, it’s a compliance failure — plus a morning of coordinator time.
Crisphive ·Flag it priority: "p0" with a hard sla_deadline; the solver protects statutory work before routine requests.
The pain ·An auditor or council asks and there’s no reproducible trail — two staff-days go into reconstructing one dispatch decision after the fact.
Crisphive ·Every preview is deterministic and replays identically — show the exact inputs and result on demand.
The pain ·A crew rolls to a live-lane job before traffic control is set, can’t start, and stands down — a wasted mobilisation and travel trip.
Crisphive ·Make-safe/traffic-control-first is declared in dependencies, sequenced ahead of the work.
▼Reading the hazard preview
The A hazard report just hit scenario above is the re-plan itself — it previews the moves so nothing is dispatched until you confirm. Its fields map to the story like this:
| Field | What it is |
|---|---|
emergency_job_id | The hazard driving the re-plan — the sinkhole that has to be made safe. |
technician_id | The unit in play for that hazard — here, the roads crew. |
start_at | When the report lands — 08:15 in the story. |
mode | How hard the solver may push to fit it in (here, allow overtime). |
displacement_mode | What may happen to the requests it moves (here, reschedule them rather than drop them). |
The urgency flag from the intro — priority: "p0" — is set when you log or update the request on POST /job-requests (the Pothole patch scenario shows a routine p3). The full priority ladder and the allowed values for mode and displacement_mode live in each endpoint’s Full reference.
▼Hard constraints, not suggestions
A dispatcher that ignores these isn’t planning — it’s missing a legal deadline and logging it as done. Each one is a first-class field in the API.
| The rule | What the API enforces |
|---|---|
| Statutory response clocks | A hazard report carries a legal sla_deadline. The solver protects statutory work before routine requests. |
| Unit skills | A sinkhole is roads, not parks. Only units whose skill_ids cover the request get assigned. |
| Equipment & barriers | Barriers, saws, vac trucks. An equipment run is modelled in dependencies, so no plan promises a job whose gear is on another unit. |
| Make-safe first | Make-safe before repair; barricade before excavation. Order is first-class dependencies. |
| Defensible & replayable | Deterministic plans replay identically — when a resident or council asks why, you show the exact inputs and result. |
▼What you ship
You ship dispatch that meets the clock.
- No hand-rolled constraint engine — statutory windows, unit skills, equipment and travel are API fields.
- Deterministic means defensible: replay any case for council, FOI or an audit.
- Citizen copy comes back with the plan, ready for the case status verbatim.
▼What their day feels like
One report stops jeopardising the whole day.
- Dispatch stops re-planning crews by hand.
- Statutory clocks are protected; the right unit gets the right hazard.
- The sinkhole is made safe inside the window — routine requests slide, not the clock.
▼Every job has stakeholders
A hazard report touches far more than the unit that clears it. Every work order is a web of stakeholders who feel it when the week drifts — and a tighter operation quietly serves all of them.
The person who reported it gets a made-safe hazard inside the statutory window and a status they can see.
Confirms a re-plan in one click instead of rebuilding the week by hand.
More requests cleared per crew-hour inside the clock — fewer breaches, a tighter operation.
Every dispatch replays deterministically — council, FOI or an auditor gets the exact inputs and result, not a story.
Statutory clocks met and drift caught early protect the city’s standing when the public is watching.
Break and collective-agreement rules honoured keep the operation compliant and the crews willing.
▼What you get back, and what gets pushed
The A hazard report just hit preview returns the whole plan in data: moves and reassignments (which requests shift, from and to which unit and time), a total_moves count, and warnings such as TECH_NOT_FEASIBLE — so you can show dispatch the re-plan before you commit it.
To keep the resident’s case status live as crews move, register a webhook endpoint and Crisphive POSTs each event to your URL with a Crisphive-Signature header. Verify it against your whsec_… secret over the raw body before you trust the payload — Webhooks has the event shape and copy-paste verify snippets.
Start building
The snippet above imports @crisphive/sdk — grab the package for your language, drop in a key, and the same call runs. Every response comes back in one { error_code, message, data } envelope.