Skip to content
SHC Docs

API response model reference

Generated file — do not edit by hand. Regenerate from the repo root with CGO_ENABLED=0 go run scripts/gen-response-models-md.go.

One page per module, one row per (method, path) the daemon serves — the same inventory as routes.md. The Response model column on each page is derived from each handler’s Go response type: the generator traces the handler to its success-path write (api.WriteMessage / api.WriteDoc, the module writer helpers, or a direct JSON encode) and prints the static type of the payload, so the column cannot drift from the code. Structs whose only JSON field is message or data render as the two wire envelopes MethodResponse[T] ({“message”: T}) and DocResponse[T] ({“data”: T}) from core/api/respond.go. Envelopes compose rather than flatten: the writer contributes one level and the handler’s payload expression may nest more, so a handler that hands api.WriteMessage a {"data": …} payload puts {"message":{"data": T}} on the wire and is documented as the nested MethodResponse[DocResponse[T]] — the exact chain the generated API client unwraps.

Origin handler means the model was derived from the handler source. annotation marks routes whose response is not a derivable JSON body (WebSocket upgrades, SSE/raw streams, proxies, file downloads); their entries are maintained in scripts/response-model-annotations.yaml and the generator fails when a route is missing from both sources or an annotation goes stale. Handlers with several success shapes list them joined with “or”. {a, b} denotes an ad-hoc JSON object with exactly those keys.

Total: 346 routes — 319 derived from handlers, 27 annotated.

Field tables for every named struct a response model references live in payload-shapes.md.