Skip to main content

Endpoint catalogue

Every route the chi router mounts, grouped by its OpenAPI tag. Click any operation to reach the generated, interactive reference for it.

Coverage

All 33 router operations — including the /healthz and /readyz probes — have a matching operation, at the same path, in apis/openapi.yaml (26 paths entries); see the coverage cross-check at the bottom of this page.

Sites​

Physical facilities/buildings. A Site is the root of the location hierarchy and the first segment of every LocationCode inside it; no Zone, Aisle or LocationSlot can exist without one.

MethodPathOperationSuccess
POST/sitesRegister a physical facility201 + Location
GET/sitesList every registered site200
GET/sites/{siteCode}Get one site200
PUT/sites/{siteCode}/roleSet a site's role in the fulfilment network200 — the site; publishes SiteRoleChanged on a real change, a repeat is a no-op; never changes capability (ADR 0037); 422 invalid-site-role
GET/site-roles/transfer-defaultsThe default transfer capability of every site role200 — [{siteRole, transferOriginEnabled, transferDestinationEnabled}], read-only (ADR 0037)
GET/sites/{siteCode}/transfer-capabilityGet a site's transfer capability200 — {siteCode, transferOriginEnabled, transferDestinationEnabled, capabilityRevision}
PUT/sites/{siteCode}/transfer-capabilitySet a site's transfer capability200 — full snapshot; publishes SiteCapabilityChanged on a real change, a repeat is a no-op (ADR 0035); 409 concurrent-modification on a concurrent change

Zones​

Behavioral classifications scoped to a Site (ambient, chilled, frozen, hazmat, forward-pick, reserve, case-pick), bundling a LocationCode's Area and Zone segments. Their TemperatureClass and Hazmat flag are exactly what PlacementRules match on.

MethodPathOperationSuccess
POST/sites/{siteCode}/zonesRegister a zone201 + Location
GET/sites/{siteCode}/zonesList a site's zones200
GET/zones/{zoneId}Get one zone200

The zone identifier in the path is the composite Site-Area-Zone, e.g. WH1-STOR-AMB.

Aisles​

Physical corridors scoped to a Zone. An Aisle carries a SequenceHint — its walk-order position, the concrete travel-distance input WES-tier planning needs — and a Direction.

MethodPathOperationSuccess
POST/zones/{zoneId}/aislesRegister an aisle201 + Location
GET/zones/{zoneId}/aislesList a zone's aisles, in walk order200
GET/zones/{zoneId}/aisles/{aisleCode}Get one aisle200
PUT/zones/{zoneId}/aisles/{aisleCode}/geometrySet an aisle's travel centreline200
POST/zones/{zoneId}/cross-aislesRegister a connection between two aisles201 (no Location)
GET/zones/{zoneId}/cross-aislesList a zone's cross-aisles200

GET /zones/{zoneId}/aisles returns aisles ordered by sequenceHint, not by registration order. That ordering is the walk order. The centreline and cross-aisle operations feed the travel graph (ADR 0017).

Location Types​

Reusable classifications of physical slot shape/kind — PalletRack, Shelf, ToteWall, BulkFloor, Staging, Amnesty — each carrying the default capacity envelope its slots inherit and a functional role (Storage by default; also Dock, Yard, WorkCenter, Drop, Staging, QC, Consolidation, Shipping — see ADR 0016).

MethodPathOperationSuccess
POST/location-typesRegister a location type201 + Location
GET/location-typesList location types200
GET/location-types/{name}Get one location type200

Placement Rules​

Declarations of which LocationTypes are legal in which Zones. Deny always wins; declaring any Allow rule for a zone turns that zone into an allow-list.

MethodPathOperationSuccess
POST/placement-rulesDefine a placement rule201 + Location
GET/placement-rulesList placement rules200
GET/placement-rules/{ruleId}Get one placement rule200

Locations​

The coded leaf slots themselves — registering, reading, decommissioning, and bulk-importing a whole building's layout from a structured export. Also exposes a slot's resolved hazmat/temperature-class classification, the concrete realization of this context's Open Host Service / Published Language for cross-context placement validation (see ADR 0008).

MethodPathOperationSuccess
POST/locationsRegister a location slot201 + Location
GET/locations/{locationCode}Get one slot200
GET/locations/{locationCode}/classificationGet a slot's resolved hazmat/temperature classification200
POST/locations/{locationCode}/decommissioningsDecommission a slot204
POST/location-importsImport a facility layout200 (partial-success report)
PUT/locations/{locationCode}/geometrySet a slot's physical geometry200

POST /locations is the endpoint where the whole chain-of-custody invariant and every applicable PlacementRule are enforced. See Bulk import for the import report shape.

Every POST in this catalogue, /location-imports and the decommissioning below included, requires a caller-supplied Idempotency-Key header when the service runs with DATABASE_URL set (ADR-0019, ADR-0044); see Conventions.

Layout — "draw the warehouse"​

The readable, drawable projections. These are assembled across the aggregates on read, never separately stored state.

MethodPathOperationReturns
GET/sites/{siteCode}/layoutGet a site's full layoutNested zones → aisles → slots, pre-ordered
GET/sites/{siteCode}/layout?format=svgsame operation, format query parameterimage/svg+xml floor plan
GET/zones/{zoneId}/gridGet a zone's 2D gridExplicit matrix: rows = Level, columns = (Aisle, Bay) in walk order
GET/sites/{siteCode}/locations?role=List a site's locations by roleFlat list of slots with the requested LocationRole (e.g. every Dock door)
POST/sites/{siteCode}/structuresRegister a fixed structure201 + Location — a wall, column, office, conveyor or other obstacle
GET/sites/{siteCode}/structuresList a site's fixed structures200
GET/zones/{zoneId}/travel-graphGet a zone's travel graphNodes (aisle/bay waypoints) and directed, metre-weighted edges
GET/distance?from=&to=Estimate travel distance{metresM, estimated, route} between two slots

Real output for the layout and grid is on Drawing the warehouse. /distance reports map topology only — never travel time or congestion. Within one zone it routes over the zone's travel graph; across zones it returns a straight-line estimate (estimated: true) only when both slots carry recorded position geometry, and otherwise refuses with 422 no-route-between-zones rather than guessing.

Health​

MethodPathOperationReturns
GET/healthzLiveness probe200
GET/readyzReadiness probe200, 503 once draining (ADR-0020) or 503 dependency-unavailable while Postgres or Kafka is unreachable (ADR 0039)

Coverage cross-check​

The router in internal/adapters/inbound/http/server.go mounts exactly these routes (the resource-creation POSTs are additionally wrapped by RequireIdempotencyKey when a database is configured):

r.Get("/healthz", s.handleHealthz)
r.Get("/readyz", HandleReadyz(s.Readiness))

r.Route("/sites", func(r chi.Router) {
r.Post("/", s.handleRegisterSite)
r.Get("/", s.handleListSites)
r.Get("/{siteCode}", s.handleGetSite)
r.Get("/{siteCode}/layout", s.handleGetSiteLayout)
r.Get("/{siteCode}/locations", s.handleListLocationsByRole)
r.Get("/{siteCode}/transfer-capability", s.handleGetSiteTransferCapability)
r.Put("/{siteCode}/transfer-capability", s.handleChangeSiteTransferCapability)
r.Post("/{siteCode}/zones", s.handleRegisterZone)
r.Get("/{siteCode}/zones", s.handleListZones)
r.Post("/{siteCode}/structures", s.handleRegisterFixedStructure)
r.Get("/{siteCode}/structures", s.handleListFixedStructures)
})

r.Route("/zones", func(r chi.Router) {
r.Get("/{zoneId}", s.handleGetZone)
r.Get("/{zoneId}/grid", s.handleGetZoneGrid)
r.Post("/{zoneId}/aisles", s.handleRegisterAisle)
r.Get("/{zoneId}/aisles", s.handleListAisles)
r.Get("/{zoneId}/aisles/{aisleCode}", s.handleGetAisle)
r.Put("/{zoneId}/aisles/{aisleCode}/geometry", s.handleSetAisleGeometry)
r.Post("/{zoneId}/cross-aisles", s.handleRegisterCrossAisle)
r.Get("/{zoneId}/cross-aisles", s.handleListCrossAisles)
r.Get("/{zoneId}/travel-graph", s.handleGetZoneTravelGraph)
})

r.Get("/distance", s.handleEstimateTravelDistance)

r.Route("/location-types", func(r chi.Router) {
r.Post("/", s.handleRegisterLocationType)
r.Get("/", s.handleListLocationTypes)
r.Get("/{name}", s.handleGetLocationType)
})

r.Route("/placement-rules", func(r chi.Router) {
r.Post("/", s.handleDefinePlacementRule)
r.Get("/", s.handleListPlacementRules)
r.Get("/{ruleId}", s.handleGetPlacementRule)
})

r.Route("/locations", func(r chi.Router) {
r.Post("/", s.handleRegisterLocationSlot)
r.Post("/import", s.handleImportFacilityLayout)
r.Get("/{locationCode}", s.handleGetLocationSlot)
r.Get("/{locationCode}/classification", s.handleGetLocationClassification)
r.Post("/{locationCode}/decommissionings", s.handleDecommissionLocationSlot)
r.Put("/{locationCode}/geometry", s.handleSetLocationGeometry)
})

That is 33 operations, every one of which has an operation at the same path in apis/openapi.yaml, grouped under 26 OpenAPI paths:

TagPathsOperations
Sites23
Zones23
Aisles46
Location Types23
Placement Rules23
Locations66
Layout67
Health22
Total2633

The two geometry operations (setAisleGeometry, setLocationGeometry) are declared at the router's /geometry paths, and GET /readyz (the Kubernetes readiness probe, ADR-0020) is part of the specification under the Health tag — earlier revisions of this page listed both as spec-vs-router mismatches.