Use casesGovernment & Municipal
Developer view · 311 & public-works software

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.

You’re building
311/citizen-request platforms and public-works management systems
On the API for
Public-works teams, crews on the road, and the resident who reported it

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.

Pothole patch · log a routine request

POST/job-requestsالمرجع الكامل
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.

1
Statutory clock starts at “submit”

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.

2
“Why did Unit 1 go there?”

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.

3
Crew works a live lane, no setup

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:

FieldWhat it is
emergency_job_idThe hazard driving the re-plan — the sinkhole that has to be made safe.
technician_idThe unit in play for that hazard — here, the roads crew.
start_atWhen the report lands — 08:15 in the story.
modeHow hard the solver may push to fit it in (here, allow overtime).
displacement_modeWhat 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 ruleWhat the API enforces
Statutory response clocksA hazard report carries a legal sla_deadline. The solver protects statutory work before routine requests.
Unit skillsA sinkhole is roads, not parks. Only units whose skill_ids cover the request get assigned.
Equipment & barriersBarriers, saws, vac trucks. An equipment run is modelled in dependencies, so no plan promises a job whose gear is on another unit.
Make-safe firstMake-safe before repair; barricade before excavation. Order is first-class dependencies.
Defensible & replayableDeterministic 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.

In plain sight
The resident

The person who reported it gets a made-safe hazard inside the statutory window and a status they can see.

The coordinator

Confirms a re-plan in one click instead of rebuilding the week by hand.

The department head

More requests cleared per crew-hour inside the clock — fewer breaches, a tighter operation.

Often invisible — until they’re not
Auditors & FOI

Every dispatch replays deterministically — council, FOI or an auditor gets the exact inputs and result, not a story.

Public trust & optics

Statutory clocks met and drift caught early protect the city’s standing when the public is watching.

Crews & retention

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.

Cascades, previews, reads and MCP access are never billed — call the solver on every disruption without architecting around your own bill. The core is a deterministic solver: same inputs, same plan, every time. The LLM only sits at the edges, turning a plan into the message your customer reads.

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.