User

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

Partial update (e.g. JSON Merge Patch): only present fields change. Per ADR 0026; OpenAPI operationId: patchUserBySystemUserId.

OpenAPI operationId (reference): patchUserBySystemUserId

Request path and behavior

Middleware per ADR 0005. Handler applies partial body with exclude_unset=True semantics; empty body after stripping → 400 USER_102 / USER_PATCH_BODY_EMPTY. Success: 200 OK.

Idempotency

Idempotency-Key required. Idempotency record key uses PATCH /api/v1/user/{system_uuid}/{system_user_id} (including the PATCH prefix) so PUT and PATCH on the same URL do not share rows. Hash uses only set fields. Details: Unified spec — Idempotency.

Errors

Envelope per ADR 0003.

HTTP Code / key When
400 USER_102 / USER_PATCH_BODY_EMPTY No fields left after unset stripping — patch_user_empty_body at warning in UserService.patch.
404 USER_404 / USER_NOT_FOUND User missing for key.
400 COMMON_400 / IDEMPOTENCY_KEY_REQUIRED Missing idempotency header.
409 COMMON_409 Idempotency payload mismatch.
422 Validation Schema validation.
401 / 429 Middleware.
500 Uncaught errors.

Logging

patch_user_idempotent_replay, patch_user_requested at info; request_done line; request_id per ADR 0023. Empty-body path logged at warning before 400.

Metrics

Same route template as PUT; distinguish by method=PATCH. 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