User

PUT /api/v1/user/{system_uuid}/{system_user_id}

Full replacement of mutable user fields for an existing row. Normative narrative per ADR 0026; OpenAPI operationId: updateUserBySystemUserId.

OpenAPI operationId (reference): updateUserBySystemUserId

Request path and behavior

Protected route; middleware per ADR 0005. Handler replaces the mutable projection (full body semantics for declared fields). Flow: idempotency gate → UserService update → repository commit. Success: 200 OK with updated user body.

Idempotency

Idempotency-Key required (same rules as POST). Endpoint key uses the literal route path with resolved UUIDs: /api/v1/user/{system_uuid}/{system_user_id}. Body hash uses the full JSON dump for comparison. Mismatch and missing-key outcomes match POST; see Unified spec — Idempotency.

Errors

Envelope per ADR 0003.

HTTP Code / key When
404 USER_404 / USER_NOT_FOUND No user for composite key — get_user_not_found at warning.
400 COMMON_400 / IDEMPOTENCY_KEY_REQUIRED Missing idempotency header.
409 COMMON_409 / idempotency mismatch Same key, different payload hash.
422 Validation Body or path validation — validation_error at warning.
413 COMMON_413 Body too large — middleware.
401 / 429 Middleware.
500 Uncaught exception logging.

Logging

request_done … (info); request_id per ADR 0023. Router: update_user_idempotent_replay (info, replay), update_user_requested (info, system_user_id, system_uuid). Service warnings before domain errors align with unified spec.

Metrics

Labels include path_template=/api/v1/user/{system_uuid}/{system_user_id}, method=PUT. Unified spec — Metrics.

Single-file deep spec

Unified internal spec — this operation.

← User resource hub

Page history

Date Change Author
Added Page history section (repository baseline). Ivan Boyarkin