The HTTP API surface
What an integrating system actually calls, and what shape it can rely on. Derived from the
JAX-RS resource classes in the build - the api/v1 packages of every module, plus
libs/karyo-license/.../LicenseResource.kt and
services/karyo-app/.../admin/AdminExtensionsResource.kt. The engine modules add resources of
their own under the same prefix; the counts below are for the resources in the module tree as of
this writing.
1. One version, one prefix, one process
Business REST resources declare paths under /api/v1: there is no /api/v2, /api/mobile or
/api/internal resource. Agent transport uses /mcp and public RFC 9728 discovery paths instead;
connecting an agent owns that read and propose surface. nginx additionally answers 404 for anything under /api/internal/
(infrastructure/docker/nginx/nginx.conf, location /api/internal/), so no such route is reachable through the proxy
even if one were added.
The method inventory is the @GET, @POST, @PUT, @PATCH and @DELETE annotations in each
module's src/main resource classes, not a separately maintained method count.
Both front ends and any integrating system call the same surface. There is no separate mobile API and no backend-for-frontend layer.
Paths are generally kebab-case plural nouns (/stock-units, /delivery-orders,
/webhook-subscriptions); the installation singleton uses /company. JSON fields are camelCase.
Domain actions are POST subpaths (/delivery-orders/{id}/release,
/webhook-deliveries/{id}/redeliver). The organization surface has GET and PUT
/company; /business-units has list, get, create and update plus /{id}/deactivate,
/{id}/reactivate, /references and /consistency.
Company and Business Units owns these contracts.
The retired /clients API has no adapter. Auth also exposes GET /api/v1/me/access, returning mode, a finite actions set,
positions entries with nodeType, nodeId and actions, and canCreateIdentity. The modes are
always SCOPED, because every principal's authority comes from its grants;
identity and tenancy
owns how authority is resolved. canCreateIdentity additionally requires the provider's
disabled-first creation and recovery capabilities. Principal and legacy User responses carry a
record-level allowedActions set; Users administration
owns its policy and the independent read boundary.
GET /api/v1/me additionally supplies the catalogue actions the principal holds anywhere and its
operational Business Unit choices, independently of the selected header; each businessUnits[]
entry carries the actions that hold somewhere in that unit. It returns no provider roles. Its
businessUnitId remains approved affiliation, not selection; the response shape is declared by
CurrentPrincipalResponse in
AuthSessionResource.kt.
It also carries the principal's accountType (HUMAN, SERVICE or SYSTEM) and capabilities:
the installation's profile, the conditional surfaces that show and the switched-off capabilities
whose open work is still draining
(ADR 0052). The console and the floor app
filter their entry points by it; no route is refused because of it.
Operational callers send X-Karyo-Business-Unit-Id with a positive integer id. The selection
must belong to the principal's readable or writable choices; each operation still requires its own
scope and the catalogue action its endpoint declares
(ADR 0048). Scalar routes without a header require exactly one authorized unit for
that operation. A Company grant with multiple units must select one.
Warehouse layout routes act in one Facility. A caller may send X-Karyo-Facility-Id to name it;
without the header the Facility is the only one the selected Business Unit has. A malformed id
returns 400 facility-selection-invalid, and a Facility outside the selected Business Unit returns
400 facility-selection-mismatch. A Facility the caller is not authorized for returns
403 facility-selection-forbidden, and an operation with no single Facility returns
403 facility-context-required.
Invalid selection returns 400 business-unit-selection-invalid; unauthorized selection returns
403 business-unit-selection-forbidden without disclosing whether the unit exists. A missing or
ambiguous Facility returns 403 facility-context-required, and a Business Unit header that names a
unit with several Facilities and no Facility header returns 400 facility-context-required. An operational request
body has no Business Unit attribute: Facility selection and grants alone determine scope, and an
unknown businessUnitId in a body is ignored like any other unknown property. Identity affiliation and
configuration routes keep their own boundaries; see scope resolution.
Seven resources declare only @Path("/api/v1") at class level and carry the full path on each
method - AuthSessionResource, PickOrderResource, ShipmentResource, PickDocumentResource,
ShipmentDocumentResource, StocktakingResource, HealthResource - so a reader cannot infer a
resource's routes from its class annotation alone.
Location Classes (pre-2.0 breaking rename)
The usage role formerly called Area is now Location Class, not a physical building division. There is no compatibility alias:
| Methods | Path | Contract |
|---|---|---|
| GET, POST | /api/v1/location-classes |
Paginated LocationClassResponse rows; create with CreateLocationClassRequest (name, usages) |
| GET, DELETE | /api/v1/location-classes/{id} |
Read or delete a Location Class |
| GET | /api/v1/locations?locationClassId={id} |
Filter by Location Class |
| POST, PUT | /api/v1/locations, /api/v1/locations/{id} |
Write locationClassId; location responses contain locationClass |
| POST | /api/v1/count-sessions |
Use optional locationClassId to expand a cycle count's locations |
Location responses include the Location Class's id, name, usages, created and modified.
Warehouse setup's check response uses locationClasses; its create response uses locationClassesCreated.
Occupancy cells use locationClassUsages.
The location label template's data key areaName is now locationClassName, with no alias; a stored override of
/templates/location-label.zpl must be updated. Usage codes, such as STORAGE and PICKING, do not change.
STORAGE does not mean bulk, nor PICKING loose; the location type and setup storage kind still describe those.
The listLocations MCP tool keeps its name; its projection never carried an Area id and carries no Location Class id.
No MCP tool was named after Area. No supported CSV header or Loci contract field carries this role,
so none changes. Loci still receives locations[].zone, not a Location Class or a physical Area.
StorageArea, WorkingArea, StorageStrategyArea and ItemDataArea keep their contracts,
including /api/v1/storage-strategies/{id}/areas. They name sets of clusters, not usage roles.
See ADR 0059.
The physical hierarchy and travel distances
/api/v1/areas now means the physical Area, a part of the building that holds zones. Until
the Location Class rename it served the usage role; that role is at /api/v1/location-classes,
and a client still written against the old Area contract gets the new resource, not an alias.
Every route below acts in one Facility, reads with layout.read and writes with layout.write
(ADR 0060):
| Methods | Path | Contract |
|---|---|---|
| GET, POST | /api/v1/areas |
Paginated AreaResponse rows, sortable by name, sequence and created; create with AreaRequest (name, description, sequence, startAlongMetres, startAcrossMetres and the four size overrides) |
| GET, PUT, DELETE | /api/v1/areas/{id} |
Read, replace or delete an Area; delete answers 409 has-dependents while zones or locations sit in it |
| GET, POST | /api/v1/aisles, /api/v1/aisles?zoneId={id} |
Paginated AisleResponse rows; create with CreateAisleRequest (zoneId, name, sequence, positionsPerBay, doubleSided and the four size overrides) |
| GET, PUT, DELETE | /api/v1/aisles/{id} |
Read, update (UpdateAisleRequest, no zoneId) or delete an aisle; fewer positions per bay than a location uses is 422 invalid-place, and delete answers 409 has-dependents while locations sit in it |
| PUT | /api/v1/zones/{id} |
New. Update a zone with CreateZoneRequest; a zone moved to another Area without a sequence goes last there. The request also carries rackDepthMetres, enclosed and the room's setPointLowC and setPointHighC; a replace that leaves enclosed out makes the zone open floor, and a set point on an open zone, a half range or an inverted range is 422 invalid-floor |
| PUT | /api/v1/zones/{id}/temperature |
Store the latest temperature of a zone, from a sensor feed or a person: {"celsius": 3.1, "recordedAt": "2026-10-26T12:00:00Z"}. recordedAt defaults to now and may not be more than five minutes ahead (422 invalid-floor); a value outside -100 to 100 or a missing one is 400; an absent or foreign-Facility zone is 404 layout-not-found. One row for each zone is kept, rounded to one decimal, and an older reading never replaces a newer one. Returns ZoneTemperatureResponse (zoneId, celsius, recordedAt). Needs layout.write |
| GET | /api/v1/floor-plan |
FloorPlanResponse: the Facility defaults, proximityEnabled, every Area, zone and aisle with its resolved start, width, length and sizes (rack depth too) and each aisle's walkingAisleMetres (never below zero), each zone's enclosed, set point range and latest reading (temperatureC and temperatureAt, both null while nothing has reported), the building (null while the plan has no extent, no dock door is stored and no building is stored), the docks and the crossAisleWidthMetres. A building or dock door carries source, STORED or DERIVED; the building also carries holdsPlan, false when a zone, a location placed by a floor point or a stored dock door lies outside the building served; a derived door has a null id |
| PUT, DELETE | /api/v1/floor-plan/building |
Replace the stored building with {"lengthMetres","depthMetres","wallHeightMetres"}, or clear it so the plan derives one. A building shorter or shallower than the plan, or one that leaves a stored dock door outside its wall, is 422 invalid-floor |
| POST | /api/v1/floor-plan/docks |
Create a stored dock door with DockDoorRequest (name, direction, wall, positionMetres, widthMetres, optional locationId); returns 201. A name in use is 409 duplicate-name, a door that does not fit the wall of a stored building is 422 invalid-floor (with no stored building a door is not bounded, but its position must be at least half its width, else 422 invalid-floor), and a location outside the Facility is 422 invalid-reference |
| PUT, DELETE | /api/v1/floor-plan/docks/{id} |
Replace or delete a stored dock door; an absent or foreign-Facility door is 404 layout-not-found |
| GET | /api/v1/floor-plan/zone-distances |
Every unordered zone pair: zoneAId, zoneAName, zoneBId, zoneBName, computedMetres, nullable correctedMetres, effectiveMetres |
| PUT | /api/v1/floor-plan/zone-distances/{a}/{b} |
Set the symmetric correction with {"metres":12.5}; returns that correction with 200. Values are non-negative with at most seven integer and two decimal places; invalid numbers answer 400, a self-pair 422 invalid-place, an absent or foreign-Facility zone 404 layout-not-found, and a Facility with karyo.proximity.enabled off 409 proximity-disabled |
| DELETE | /api/v1/floor-plan/zone-distances/{a}/{b} |
Clear the correction and return 204, also when already clear; validates the same zone pair, and answers 409 proximity-disabled while the Facility has karyo.proximity.enabled off |
| GET | /api/v1/locations/floor |
A list of FloorLocationResponse for the Locations floor view: each location's place, resolved point in metres (absent when it has no physical place), allocation and lockType |
| GET | /api/v1/locations/{id}/floor-point |
LocationFloorPointResponse: alongMetres, acrossMetres, heightMetres and source (AISLE, FLOOR_POINT, ZONE_ENTRY, AREA_ENTRY); a location with no zone and no Area is 422 location-has-no-place |
| GET | /api/v1/locations/{id}/distance?to={id} |
LocationDistanceResponse: walkMetres, liftMetres and route (SAME_AISLE, SAME_ZONE, SAME_AREA, OTHER_AREA); a missing to is 400; a to that names no location of the Facility is 422 invalid-reference, while an unknown {id} is 404 |
Zone distances measure only the walking leg from one zone door to the other. The location distance
route adds the walks inside each zone. Corrections replace that leg for all distance consumers,
including immutable flow snapshots, without changing same-zone or same-aisle travel. Reversing
a and b addresses the same correction. Clearing uses the current layout's computed value.
The console displays this table only when the selected Facility enables proximity. Setting or
clearing a correction needs layout.write and karyo.proximity.enabled on for the Facility;
with it off, both routes answer 409 proximity-disabled. Reading the table needs only
layout.read and works whatever the setting says. Corrections stored earlier stay in force while
proximity is off, and every distance consumer still reads them.
Changed contracts: ZoneResponse and CreateZoneRequest gain areaId, sequence,
startAlongMetres, startAcrossMetres, aisleSpacingMetres, bayWidthMetres and
levelHeightMetres; a zone created without areaId goes into the Facility's first Area, and
into a new Main Area when it has none. LocationResponse gains place (areaId, areaName,
aisleId, aisleName, bay, level, position, floorAlongMetres, floorAcrossMetres), and
CreateLocationRequest and UpdateLocationRequest accept an optional place with the same
writable fields. On an update a null place keeps the stored place and a given one replaces it
whole. A place that breaks a rule, such as a bay without an aisle or a floor point on an aisle
location, is 422 invalid-place. rack, field, section, xPos, yPos and zPos keep their
meaning. The Facility sizes are the runtime settings karyo.layout.aisle-spacing-metres,
karyo.layout.bay-width-metres and karyo.layout.level-height-metres. No MCP tool, CSV header,
webhook event or Loci contract field changes.
Proximity putaway (ADR 0061)
adds to these contracts. The Facility's setting for it is the runtime setting karyo.proximity.enabled, which has
no route of its own. The storage strategy sorts accepts TRAVEL_DISTANCE, and
StorageStrategyResponse gains facilityDefault, true for the one strategy a putaway uses when
nothing names one. The LocationFinder SPI's LocationFinderRequest gains originLocationId, the
location the walk is measured from. No MCP tool, CSV header, webhook event or Loci contract field
changes.
Proximity pick routing (ADR 0062)
adds proximityRoute to order-strategy create, update and response contracts. Source selection
separately adds pickSourceOrder, accepting FIFO (the default) or SAME_DAY_NEAREST.
The latter uses the Facility gate and ranks only within a rotation day of the Facility's local calendar, as specified in
Stock selection. An omitted update leaves the mode unchanged;
an unknown value answers 400. proximityRoute defaults to
false; omitting it on update leaves it unchanged. It takes effect at pick-order creation only
while the Facility's karyo.proximity.enabled is on. PickResponse adds the saved sequence, null on work created before it existed.
Pick-order responses return their picks by sequence (nulls last), then id, including wave batches. Bulk lines
follow the first pick for each source stock unit. No endpoint, action, webhook or CSV field changes.
The in-process LocationDistanceLookup and its immutable snapshot add route, with a null start
meaning the first Area's entry. Unplaced locations follow by location walking order, then id.
Proximity task interleaving (ADR 0063) adds two routes to the work inbox, both for the caller in the Facility of the request:
| Method | Path | Meaning |
|---|---|---|
| GET | /api/v1/work/position |
OperatorPositionResponse: active (true while the Facility's dispatch orders work by position), then locationId, locationName, source (CONFIRMATION or SCAN) and recordedAt, all null while no position is known. Needs inventory.read |
| GET | /api/v1/work/positions |
The operators last known to stand in the Facility within the last 12 hours, newest first: a list of operatorId, locationId, locationName, source (CONFIRMATION or SCAN) and recordedAt. Empty while the Facility does not dispatch by position, because positions are kept only then. Needs work.positions.read, held by the Manager profile |
| PUT | /api/v1/work/position |
The "I am at" scan. Body {"locationId": 12}; returns the response above. A location that is not a location of the Facility is 422 invalid-reference. Needs work.claim |
WorkItemResponse is unchanged, but primaryLocationId is now set on PICK items while the Facility dispatches by position.
The settings karyo.work.dispatch-strategy and karyo.work.proximity.max-wait-minutes have no route of their own; a value the
catalogue does not accept is 422 system-property-invalid-value. No MCP tool, CSV header or webhook event changes.
Health and readiness
GET /q/health/live is the only public management route. It is anonymous and returns only
status and an empty checks list. nginx returns 404 for other /q/ paths, including aggregate
health, readiness, startup and metrics. Container probes continue to read
http://localhost:8080/q/health/ready internally, with HTTP 503 for a DOWN report.
GET /api/v1/admin/health requires a signed-in principal holding settings.manage at the Company node,
matching Admin > Health. It is installation administration, so a grant at a Business Unit or
Facility does not reach it. It returns the
SmallRye readiness shape { status: "UP" | "DOWN", checks: [{ name, status, data? }] } with
Cache-Control: no-store. An authorized report has HTTP 200 even when its body says DOWN, so
clients can display failed checks. Authentication and authorization refusals use the standard
401 and 403 problem bodies. The console uses its authenticated API client with no anonymous fallback.
Configuration namespaces
PUT /api/v1/system-properties/{key} accepts catalog keys and case-sensitive ext. keys only.
An unknown non-ext. key returns 422 system-property-unknown-key; an invalid catalog value
still returns 422 system-property-invalid-value. Catalogued deployment-only settings still return
403 system-property-environment-only. GET retains existing unknown rows, marked by type: null;
DELETE can remove them. No stored row is rewritten by this change.
POST /api/v1/order-strategies and PUT /api/v1/order-strategies/{id} keep their JSON shapes.
A created or supplied extensionProperties map validates Karyo's fourteen wave and streaming keys;
all other keys must start with ext.. Invalid keys or values return
422 order-strategy-invalid-extension, with detail beginning extensionProperties.<key>:.
This identifies the field without adding fields to the problem response. Older stored maps keep
their runtime parsing, and an update that omits extensionProperties neither validates nor changes them.
See the configuration reference
for the fourteen keys, allowed values and defaults.
2. REST has no OpenAPI description
No module declares the SmallRye OpenAPI extension. gradle/libs.versions.toml has no OpenAPI
coordinate, services/karyo-app/build.gradle.kts, dependencies (Quarkus extension union) lists the assembled Quarkus extension union
and OpenAPI is not in it, and the whole source tree contains zero imports of
org.eclipse.microprofile.openapi. /q/openapi and /q/swagger-ui do not exist, and nginx would
not proxy them if they did: only exact /q/health/live is exposed (nginx.conf).
MCP publishes schemas for its curated read, prepare and proposal tools, not for the whole REST API.
For a REST integrator, the source remains the main contract. It also sits uneasily with the rest of the product, which ships
an integrator permission profile and a webhook hub addressed to exactly the caller that would need a published
description.
The one machine-checked contract that does exist is Pact, and it covers only what the desktop
console uses: four consumer suites under frontend/web/src/test/pact/ (inventory, location,
product, user) against four provider tests under services/karyo-app/src/test/kotlin/**/pact/
(auth, inventory, layout, product), verified every night by the nightly Pact verification check (contract testing). The auth pact includes principal
allowedActions and /api/v1/me/access; most of the surface still has no contract artefact.
3. Pagination is opt-in per resource
libs/karyo-common/.../pagination/PaginationParams.kt is a @BeanParam carrying page
(default 0), size (default 20) and a repeatable sort. PaginatedResponse wraps results as
{ content: [...], page: { number, size, totalElements, totalPages } }.
Some resource classes return it; others return a bare List<T> with no envelope, no total and
no page: among them
/api/v1/journals, /api/v1/unit-loads, /api/v1/webhook-subscriptions, /api/v1/monitors,
/api/v1/alerts, /api/v1/replenishment (needs), /api/v1/report-definitions, /api/v1/work/mine and
/api/v1/order-strategies. A client cannot tell from the URL shape which kind it will get.
Seven bare lists accept an optional window: journals, pick orders, shipments, unit loads (the
locationId list), webhook subscriptions, monitors and alerts take a limit of 1 through 200 and a
nonnegative offset up to 5,000,000. Supplying a nonzero offset requires a limit, and a request with
neither returns the whole list as it always did. The windowed reads keep the bare list shape and a
stable newest-first order (unit loads: by id; monitors: catalogue order). MCP uses a 51-row lookahead
window.
PaginationParams clamps size at 500 (PaginationParams.MAX_SIZE): a request for more is answered
with a 500 row page and page.size says 500, not an error. A resource may clamp tighter. The
documents list clamps at 200 (DocumentStoreService.list) and the count sessions list at 200
(StocktakingService.listSessions). The stock units and delivery orders CSV exports read through
PaginationParams.unbounded, and the pick orders export cuts its rows in Kotlin, each for the same
10,000-row bound - see §5.
SortParser.parse (libs/karyo-common/.../pagination/SortParser.kt, SortParser) validates each
field,direction pair against a per-resource allowlist and silently drops anything not on it,
falling back to the resource's default sort when nothing survives. A caller who misspells a sort
field gets a successful 200 in a different order than it asked for, with no signal.
Insight routes recompute on every request
GET /api/v1/forecasts and GET /api/v1/simulations/reorder take no page, filter or product
parameter. Each reads the Facility's picks of the last 90 days, runs the forecast model over every
product on the request thread, and returns every product in one body. Neither caches anything. The
flow routes (/api/v1/flow/state, /projection, /simulation and /replay) do the same over the
last 28 days; their figures are in the flow model.
This is a known issue, kept on purpose: a cached read model would need rules for when its answer is too
old, and neither engine has needed them yet. What the issue costs is measured.
The figures are the medians of single requests, one caller at a time, after two warm-up requests, on
an 8-core Ryzen 7 5800X3D with PostgreSQL 16 in a container on the same host and the application in
quarkusDev. Read them as a ratio, not as a capacity claim. The data is the demo Riverside Facility
repeated 1, 10, 50, 200 and 1,000 times
(how to take the figures).
| Products picked in 90 days | Pick rows in 90 days | forecasts |
simulations/reorder |
Body of forecasts / reorder |
|---|---|---|---|---|
| 24 (the demo) | 1,302 | 8 ms | 10 ms | 6 KB / 10 KB |
| 240 | 13,020 | 33 ms | 62 ms | 62 KB / 96 KB |
| 1,200 | 65,100 | 0.17 s | 0.30 s | 312 KB / 479 KB |
| 4,800 | 260,400 | 0.85 s | 1.3 s | 1.3 MB / 1.9 MB |
| 24,000 | 1,302,000 | 5.3 s | 6.7 s | 6.3 MB / 9.6 MB |
- Both grow in step with the pick rows they read: about 3 to 4 milliseconds for every 1,000 rows for
forecastsand about 5 forreorder. Neither needs more than a third of a second up to 1,200 products picked in 90 days. At 4,800 they need 0.85 s and 1.3 s, and at 24,000 they need 5 to 7 s. - The body grows with the products and is never paged, so a client of the 24,000-product Facility receives 6 to 10 MB for each call.
- Two callers at once on each of the four routes (eight requests in flight) raised the medians by about half at 4,800 products and doubled them at 24,000.
- A Facility that picks 1,000 products or fewer is answered within a third of a second. A larger one should not open these routes on a screen that refreshes, and an integrator should call them rarely.
4. Filters are declared per resource; there is no query language
Each resource declares its own @QueryParam set. There is no generic operator suffix, no
field.gt/field.like/field.in, and no cursor pagination anywhere in the tree. An unrecognised
query parameter is simply ignored by JAX-RS, so a wrong filter name silently widens the result set
rather than failing.
5. CSV export is a separate, capped surface
Three endpoints emit text/csv rather than JSON: GET /api/v1/stock-units/export.csv
(StockUnitResource.exportCsv), GET /api/v1/delivery-orders/export.csv
(DeliveryOrderResource.exportCsv) and GET /api/v1/pick-orders/export.csv
(PickOrderResource.exportCsv). All three route through
libs/karyo-documents/.../CsvWriter.kt, which is RFC 4180 with a UTF-8 BOM, CRLF line endings and
OWASP formula-injection escaping on every field (CsvWriter.asCsvField) - a leading =, +, -,
@, tab or CR is apostrophe-prefixed unless the whole field is a plain decimal.
All three share one row cap, CsvWriter.EXPORT_MAX_ROWS = 10_000 (CsvWriter.EXPORT_MAX_ROWS).
Every export response carries the header X-Karyo-Truncated (true or false). When the true
total exceeds the cap, X-Karyo-Truncated is true, the body holds the first ten thousand rows,
and write also appends a literal line # truncated at 10000 rows for a person reading the file
(CsvWriter.toResponse, CsvWriter.write). A program should read the header, not parse the body.
The endpoints accept no page or offset parameter, so there is still no way to retrieve rows beyond
the first ten thousand. Stock units and delivery orders take query filters that narrow the export;
pick orders take none.
6. Media types and downloads
Ordinary resources declare @Produces(MediaType.APPLICATION_JSON). Document downloads declare their
own: application/pdf for the PDF routes, text/plain for the ZPL routes, text/csv for the three
exports. Format is carried by a file extension in the path
(/shipments/{id}/bol.pdf, /shipping-units/{id}/label.zpl, the CSV exports above), not by
content negotiation; there is no Accept-driven variant anywhere.
StockUnitResource.exportCsv records the practical consequence of that choice: a literal segment
such as the CSV export's must be declared before the /{id} template, or JAX-RS captures it as an
id and the Long conversion fails.
7. PATCH exists; the partial-update type is used somewhere else
libs/karyo-common/.../patch/Patchable.kt is the tri-state wrapper (absent / null / value) that
makes a partial update expressible, registered as a Jackson module by
services/karyo-app/.../config/JacksonConfig.kt. Three DTOs use it:
UpdateProductRequest, UpdateDeliveryOrderRequest and UpdateOrderStrategyRequest. On
UpdateProductRequest, zoneId is one of the patchable fields: absent leaves the product's Facility
zone as it is, null clears it, a value sets it.
All three are consumed by @PUT methods (ProductResource.updateProduct,
DeliveryOrderResource.updateOrder, OrderStrategyResource.updateStrategy). The two @PATCH methods in the
build - WebhookSubscriptionResource.update and MonitorResource.update - take plain nullable-field
DTOs instead. So the verb that means "partial" and the type that expresses "partial" do not meet
anywhere in the API, and nothing records why.
8. What the surface does not have
None of the following exists anywhere in the application or its proxy, and an integrator should not plan around any of them:
| Absent | Evidence |
|---|---|
| OpenAPI / Swagger UI | §2 |
| CORS headers | nginx.conf sets none; application.yaml configures no quarkus.http.cors. A browser client on another origin cannot call the API |
| Rate limiting or quota | No limit_req/limit_conn in nginx.conf; no fault-tolerance rate limiter on any resource |
Idempotency keys, ETag / If-Match |
Principal provisioning takes an Idempotency-Key header. Warehouse setup keeps its body idempotencyKey; arrangement save keeps its body version. There is no general ETag contract. X-Correlation-Id is logging metadata and the correlation of the journal rows a request writes (identity for an integrating system). |
Deprecation / Sunset headers |
No resource or filter emits either |
| HATEOAS links | No _links in any DTO |
| Bulk import, file upload, EDI | The build has no generic upload route at all (the only body-bearing upload belongs to the document-templates engine, see Documents and printing); the integration hub's build-file comment lists import/export and ERP adapters as not yet built (settings.gradle.kts, include of karyo-webhooks-api and karyo-webhooks-core (integration-hub comment)) |
| TLS at the application edge | nginx.conf, listen 80 is listen 80. TLS in front of the stack is the operator's; see Deploying |
The single body-size limit that does apply to every request is nginx's client_max_body_size 10m
(nginx.conf, client_max_body_size).
9. One resource, two authority tiers on the same path
HomeLayoutResource (services/auth-service/karyo-auth-core/.../api/v1/HomeLayoutResource.kt)
answers six methods under /api/v1/home-layout, split by who the layout belongs to rather than by
a separate resource class. The three collection routes act on the caller's own (business_unit_id, principal UUID)
and need only a signed-in principal: GET (HomeLayoutResource.mine) resolves the caller's effective layout down the
ladder, PUT (HomeLayoutResource.saveMine) saves it, DELETE (HomeLayoutResource.resetMine) resets it so the next rung answers. The three
/default routes administer the client's fallback layout and declare the home.manage action,
which the standard administrator profile holds: GET (HomeLayoutResource.default), PUT (HomeLayoutResource.saveDefault) and DELETE
(HomeLayoutResource.resetDefault), where GET and DELETE take an optional businessUnitId query parameter and PUT an optional businessUnitId body field that
an OPS caller may set where its grant reaches. Key 0 is the Company layer, not a Business Unit.
A BUSINESS_UNIT_USER may target only its own unit.
| Method | Path | Requires |
|---|---|---|
| GET | /api/v1/home-layout |
@Authenticated |
| PUT | /api/v1/home-layout |
@Authenticated |
| DELETE | /api/v1/home-layout |
@Authenticated |
| GET | /api/v1/home-layout/default |
home.manage |
| PUT | /api/v1/home-layout/default |
home.manage |
| DELETE | /api/v1/home-layout/default |
home.manage |
10. Identity and principals
GET /api/v1/auth/config exposes only public browser OIDC settings. Authenticated callers read the
normalized local projection from GET /api/v1/me. /api/v1/principals is the provider-neutral
management surface for listing, provisioning, local suspension/restoration, unlinking and the
provider actions its advertised capabilities support. Exact visibility and mutability are checked
against the actor and target principal; unsupported provider actions return a typed capability
conflict and have no side effects. Each principal carries created, the time Karyo created it; the
list sorts by sort=<field>,asc|desc over username, email, firstName, lastName, enabled
and createdTimestamp, oldest first when none is named. /api/v1/users/affiliations lists the Business Units a Users
form may name; there is no other /api/v1/users route.
/api/v1/principals/{id}/grants lists a principal's stored grants (GET), grants a permission
profile at a Company, Business Unit or Facility node (POST, body nodeType, nodeId,
permissionProfileId), and revokes one (PUT .../{grantId}/revoke, idempotent). Granting and
revoking need permissions.delegate and every action of the profile at that node; each writes an
identity change fact, and a revoked grant returns only through a new grant. Revoking the last
active Company grant that carries permissions.delegate is refused with a 409
last-company-delegation-grant problem, because nothing could restore Company authority.
GET /api/v1/permission-profiles lists the finite profiles, their actions and the node types each
can be granted at.
/api/v1/capabilities is the Capabilities panel: GET reads the profile and the twelve Extended
capabilities, POST /preview returns what would show or hide without writing, and PUT applies a
change only with confirmed: true (otherwise 422 capability-change-unconfirmed). All three
declare settings.manage and answer only a caller who holds it at the Company
(403 capability-change-forbidden). /api/v1/setup reports System, the setup account of a fresh
installation (GET, users.read), and POST /api/v1/setup/complete (users.manage) lets System
alone finish setup once an Administrator and a Manager exist (409 setup-incomplete before then)
(ADR 0053).
11. Warehouse setup: one plan route, one pasted-list route, one arrangement
WarehouseSetupResource
(services/warehouse-layout-service/karyo-layout-core/.../api/v1/WarehouseSetupResource.kt) answers
four methods under /api/v1/warehouse-setup. Setup creates many locations at once from typed label
ranges or a pasted list (Set up a warehouse,
ADR 0036).
| Method | Path | Declared action | What it does |
|---|---|---|---|
| POST | /api/v1/warehouse-setup/plan (WarehouseSetupResource.plan) |
layout.write |
One route, three modes. PREVIEW reads and draws a plan and touches no table; CHECK compares it with what the installation holds and writes nothing; CREATE writes it all in one transaction under an idempotencyKey. CHECK and CREATE need an explicit authorized targetFacilityId |
| POST | /api/v1/warehouse-setup/read-list (WarehouseSetupResource.readList) |
layout.write |
Turns pasted text into the ranges and stand-alone places that reproduce exactly the names pasted |
| GET | /api/v1/warehouse-setup/arrangement (WarehouseSetupResource.getArrangement) |
arrangement.read |
The saved flow of goods and dock-door counts |
| PUT | /api/v1/warehouse-setup/arrangement (WarehouseSetupResource.saveArrangement) |
layout.write |
Saves them, with an optional version for an optimistic conflict check |
Every refusal is the ordinary problem body (the error contract), with a
customer-worded detail: setup-invalid (422), setup-facility-required (422),
setup-facility-forbidden (403), setup-facility-inactive (422), setup-config-conflict (409),
setup-idempotency-conflict (409), setup-changed (409) and
arrangement-conflict (409). A CREATE answers 200 both for the first result and for a replay of the
same key (outcome.replayed), so a retrying client has one response shape. A large PREVIEW or
CHECK is run-based: above 4,000 locations the preview carries at most one summary per physical run,
not one entry per location.
Related
- The error contract - what a failure looks like on the wire
- Identity for an integrating system - how a caller authenticates at all
- Webhooks and the event catalogue - the push half of the surface
- ADR 0017 - why the surface is versioned at
/api/v1