<!-- x-shc-release: version=2.4.25 op_fingerprint=1d9dbe9b2226eacbb1a53e3ec171f78cbeae113fa89487119fb41404f3fdbadb op_count=179 contractFingerprint=2a279c934c85de3025221ddb75962c732ceb6c153f987246509fb8fcf33e7cdc -->
# SHC User API -- changelog

Stable, pinnable URL: `https://blesta.sovereignhybridcompute.com/user-api/CHANGELOG.md`.

Contract stability rule: **additive-only within a minor version.** New optional fields, new
operations, new examples, and new vendor extensions (`x-*`) may appear without a major bump; existing
`operationId`s, paths, required-field sets, and response shapes do not change under a minor. Renamed
`operationId`s keep an alias; deprecations are flagged at least one minor ahead. Integrators may pin to a
given `info.version` and to the request-body contracts published in the spec.

---

## 3.0 (unreleased)

- Completed matching persisted replays return HTTP 409 with code
  `idempotency_replay_unavailable` and message `request already processed, look up resulting resource`;
  the request is not executed again. This covers batch, route, order, event subscription,
  and confirmation replay readers. Fingerprint conflicts and in-progress requests retain their existing behavior.

---

## 2.4.25 (2026-11-19, non-breaking)

**Why**
- The AI Serving service was live for customers, but its delivery state and granted-key metadata were not
  visible through the API. These two read-only operations expose the AI serving key and status listings,
  so a customer or agent can check delivery without a support ticket.

**Added**
- `GET /ai-serving/keys` (`listAiServingKeys`) returns metadata for the authenticated client's AI Serving
  keys: `label`, `key_id`, `status`, and the last-used timestamp as an RFC 3339 `last_used`. It never
  returns key material, principals, idempotency values, or context references.
- `GET /ai-serving` (`listAiServingStatus`) returns the authenticated client's active package-323 AI
  Serving services with their delivery state, claim attempts, and whether a current key is recorded.

**Changed**
- Historical ISO action receipts from before the upgrade may return 409 `replay_unavailable` for up to 24 hours; the original action is not re-executed. Read the current state with `GET /vm/{serviceId}/iso`.

**Fixed**
- Corrected package backup and snapshot limits and cloud-init lint report schemas to match served values.
- The published rekey success schema now matches the served body; the served body did not change.

**Security**
- Both operations are read-scoped in the `client_services` area, callable with Basic auth or a customer
  API key, and exposed as MCP tools. They change no state and are not confirmation-gated.

**Replay (gate fix B3)**
- Completed matching persisted replays return the rebuilt owner-scoped result: the stored status is
  reused and only safe owner-scoped metadata is projected from the stored response (batch items keep
  their correlation id and status only; one-time secrets such as event-subscription signing secrets and
  agent-session tokens are never re-sent). When no safe field survives the projection, the replay
  returns HTTP 409 with code `idempotency_replay_unavailable` and message `request already processed,
  look up resulting resource`. Replays never re-execute the backend operation, never mutate the
  resource, and never return the stale stored body.

**Contract**
- Operation count: 179. Additive only: no existing operation, path, request body, response shape, auth
  requirement, or enforcement behaviour changed.

---

## 2.4.24 (2026-07-19, non-breaking)

This entry covers all of the day's work. It was developed as several small iterations
(2.4.16 through 2.4.24); they are consolidated here so the history reads as one change
rather than six, which is how it should have been released in the first place.

**Why**
- The published contract could not be code-generated. `Problem.x-error-code` declared two values
  that normalise to the same identifier key, so `openapi-python-client` aborted with
  `ValueError: Duplicate key CLOUD_INIT_POLICY_VIOLATION`. Anyone regenerating a typed client was
  stuck on an older release.
- The confirmation challenge behind `409 confirmation_required` existed only in prose. With no
  schema, a generated client could not type `confirmation_id` and had to guess where to read it
  from - and the legacy nested location is absent in some responses.
- Fourteen confirmation-gated operations did not declare a `409` at all.
- Nothing in the contract said which operations are reachable as MCP tools, and the advertised
  tool count was the operation count.
- Several published pages described our internal build process, named another customer, or led
  with cryptographic fingerprints instead of telling you how to use the API.

**Added**
- `ConfirmationChallenge` schema. Read `confirmation.confirmation_id` - it is always present.
  The copies nested under `structuredContent` are legacy and may be absent. A `confirmation_id`
  is single-use, non-secret, and is not permission: re-send the identical request with
  `X-User-Api-Confirm` only after an explicit yes to that specific action.
- `Error.confirmation` (optional). Optional because `409` is also returned for ordinary conflicts
  such as idempotency-key reuse; discriminate on `error.code == "confirmation_required"`.
- A documented `409` on the fourteen gated operations that omitted one. All 53 now declare it.
- `x-shc-mcp-exposure` on every operation: `exposed` (157) or `hidden` (20), so tooling can tell
  from the contract alone which operations are available as MCP tools.

**Fixed**
- Removed the duplicate `x-error-code` enum value that blocked code generation. No behaviour
  change: the removed spelling was never emitted, and the value the server actually returns is
  unchanged.
- `claimAgentKey` and `mintVmConsoleSession` moved to the `Account` and `Virtual Machines` tags
  they belong to, so generated clients stop producing near-empty extra classes.
- `serverInfo.catalog.tool_count` now reports the tools actually served (157), not the operation
  count (177).
- Corrected which operations are REST-only: it is the identity and credential class - two-factor,
  password, API keys, agent sessions, Nostr identity, registration and account-contact updates -
  which stay Basic+OTP-only by design.
- The docs landing page now opens with what the API is, the base URL, how to authenticate and how
  confirmation works. Release fingerprints are still published, at the end, where they belong.
- The API description no longer repeats release history that is already in this changelog, and no
  published page describes our internal build process or names another customer.
- Improved text contrast on this documentation site. Body copy previously dropped straight from
  near-white headings to a mid-grey that measured 7.3:1 on the dark theme and only 5.1:1 on the
  light one, which read as washed out and made every section look like a bright title above
  faded text. Body copy now sits a step higher (12.7:1 dark, 11.2:1 light), leaving the lighter
  grey for genuinely secondary details like dates, version chips and endpoint hints.

**Documented**
- Thirteen operations that were live but whose success response was published as an unfinalised
  placeholder now carry their real response schema: the four Nostr identity operations, contact
  update, downloads listing, account-manager update, order fetch and pending-order cancel,
  quotation approval, support-ticket feedback, and the two read-only VM term operations. Each
  schema was derived by reading the handler through to its return, not inferred from the
  endpoint name, so a generated client can now type these responses instead of hand-writing them.
- One operation, `changeVirtualMachineTerm`, deliberately keeps its placeholder for now. It is
  the one that creates a prorated invoice, and its shape could not be confirmed to the same
  standard as the others. A schema we are not certain of would be worse than an honest
  placeholder, so it waits until it can be verified against a live response.

**Contract**
- Operation count: 177. Additive and editorial only. No operation, path, request body,
  response shape, auth requirement, or enforcement behaviour changed, and the operation
  fingerprint is unchanged from 2.4.15. Every `409` added documents a status these operations
  already returned.

---

## 2.4.23 (2026-07-19, non-breaking)

A same-day development step toward 2.4.24. See the 2.4.24 entry for the
consolidated description of what changed and why. No operation, path, request body, response
shape, auth requirement, or enforcement behaviour changed in this step.

- Operation count: 177.

---

## 2.4.22 (2026-07-19, non-breaking)

A same-day development step toward 2.4.23. See the 2.4.23 entry for the
consolidated description of what changed and why. No operation, path, request body, response
shape, auth requirement, or enforcement behaviour changed in this step.

- Operation count: 177.

---

## 2.4.21 (2026-07-19, non-breaking)

A same-day development step toward 2.4.22. See the 2.4.22 entry for the
consolidated description of what changed and why. No operation, path, request body, response
shape, auth requirement, or enforcement behaviour changed in this step.

- Operation count: 177.

---

## 2.4.20 (2026-07-19, non-breaking)

A same-day development step toward 2.4.21. See the 2.4.21 entry for the
consolidated description of what changed and why. No operation, path, request body, response
shape, auth requirement, or enforcement behaviour changed in this step.

- Operation count: 177.

---

## 2.4.19 (2026-07-19, non-breaking)

A same-day development step toward 2.4.21. See the 2.4.21 entry for the
consolidated description of what changed and why. No operation, path, request body, response
shape, auth requirement, or enforcement behaviour changed in this step.

- Operation count: 177.

---

## 2.4.18 (2026-07-19, non-breaking)

A same-day development step toward 2.4.21. See the 2.4.21 entry for the
consolidated description of what changed and why. No operation, path, request body, response
shape, auth requirement, or enforcement behaviour changed in this step.

- Operation count: 177.

---

## 2.4.17 (2026-07-19, non-breaking)

A same-day development step toward 2.4.21. See the 2.4.21 entry for the
consolidated description of what changed and why. No operation, path, request body, response
shape, auth requirement, or enforcement behaviour changed in this step.

- Operation count: 177.

---

## 2.4.16 (2026-07-19, non-breaking)

A same-day development step toward 2.4.21. See the 2.4.21 entry for the
consolidated description of what changed and why. No operation, path, request body, response
shape, auth requirement, or enforcement behaviour changed in this step.

- Operation count: 177.

---

## 2.4.15 (2026-07-16, non-breaking)

**Why**
- Account owners could read their two-factor status through the API but could not manage it there; enabling or disabling two-factor still required the web account form.
- A prior native-webhook delivery migration landed in the running service ahead of a release and needed to be folded into the tracked surface so the published contract matches enforcement.

**Added**
- `POST /account/2fa/enrollment` (`beginTwoFactorEnrollment`) mints a candidate TOTP secret and returns the key, a base32 secret, and an `otpauth://` provisioning URI. It does not change two-factor state.
- `POST /account/2fa` (`enableTwoFactor`) enables TOTP two-factor. It requires the current account password and a valid one-time code for the enrolled key.
- `DELETE /account/2fa` (`disableTwoFactor`) disables two-factor. It requires the current account password.

**Security**
- All three operations are Basic-auth-plus-OTP identity operations (area `__identity__`), the same class as password change and Nostr identity linking. They are not callable with an API key or an agent session; a stored credential cannot enable or disable the account's login factor. Disabling requires re-authentication, so an active session alone cannot silently strip two-factor.
- Two-factor is treated as a protection toggle: enable and disable are marked `protection_toggle` in the operation matrix.

**Changed**
- Operation count: 177. Existing operations, request/response contracts, and enforcement are unchanged.
- Webhook delivery now uses the native Webhooks path; the `callback` column was widened and delivery/dead-letter bookkeeping columns were added. No customer-facing request or response contract changed.

---

## 2.4.14 (2026-07-15, non-breaking)

**Security**

- Reclassified VM credential retrieval as a secret-read confirmation-gated operation.
- Added first ZK backup registration confirmation requirements.
- Added coherent ZK recipient status/list/register/revoke/rekey surfaces in later staged phases.
- Made ZK rekey rotate-forward by default: future backups use the new recipient set, while existing backups stay openable by the recovery keys they were sealed to until the customer re-uploads the backups they care about.
- Documented the self-custody guarantee: SHC cannot re-seal, claw back, or reach into existing backup data; exposed recovery keys are handled by rotating forward to a fresh recipient set, like sweeping a Bitcoin key to a fresh address.
- Operation count: 174.

**ZK Contracts**

- Added derivation and KAT contract artifacts, PQ hybrid recipient metadata, and hygiene runbooks in later staged phases.

---

## 2.4.13 (2026-07-14, spec-accuracy)

**Why**
- A static audit found six operations whose advertised auth metadata was weaker than what the API has always enforced. The advertisement now tells the truth; enforcement is unchanged.

**Changed**
- Corrected the advertised auth scope/confirmation requirement for 6 operations to match enforcement.
- `linkNostrIdentity`, `unlinkNostrIdentity`, and `updateNip05` are Basic-auth-plus-OTP identity operations and were never callable with an API key; they are now advertised as identity operations and no longer appear as API-key tools.
- `updateAccountManager` and `updateContact` require a full-scope key (an operate key has always been rejected); the spec now advertises `full`.
- `rekeyVirtualMachineZkBackup` has always required confirmation before executing; the catalog and tool annotations now advertise `x-shc-confirm-required: true` and mark it destructive.
- Operation count: 169. The operation set, request/response contracts, and enforcement behavior are unchanged; only advertised auth metadata moved, in the stricter direction.

**Security**
- No enforcement change. Callers that already used the documented Basic-auth flow, a full-scope key, or the confirmation flow are unaffected. Generated clients that trusted the previous weaker advertisement will now correctly require the stronger credential or confirmation up front instead of failing at call time.

---

## 2.4.12 (2026-07-14, security-hardening)

**Security**
- Access-mutating VM operations (SSH-key apply, ISO mount, firewall changes, console session) now require confirmation, consistent with reinstall/cancel.
- Reverse-DNS writes, ISO unmount, SSH-key removal, firewall rule edits, and cloud-init apply/revert use the same confirmation flow when they alter VM access, boot, or network-security posture.

**Changed**
- Operation count: 169. The operation set is unchanged; this release tightens confirmation metadata and generated guidance for existing operations.

---

## 2.4.11 (2026-07-14, non-breaking)

**Why**
- Managed-account users needed a single confirm-gated switch operation to act on an already accepted managed client without broadening account access.
- The public changelog also needed to preserve every deployed 2.4.x customer-facing release note in order, with no gaps between the current version and the 2.4.0 floor.

**Added**
- `POST /managed-accounts/{managedClientId}/switch` (`switchManagedAccount`) is live and confirm-gated.
- The switch response returns the effective area set already granted to the manager on the target client.
- The generated changelog now includes every public release section from `2.4.11` through `2.4.0`.

**Changed**
- Operation count: 169. The API version and operation count remain on the managed-account release line.
- Subsequent acting-as calls use `X-Managed-Client-Id` and remain bound to the route's native area plus the manager's target-specific grant.

**Security**
- Managed-account acting-as requires accepted invitations plus contact permission grants and same-company relationships.
- `_managed` is not grantable for acting-as calls.

---

## 2.4.10 (2026-07-13, non-breaking)

**Why**
- The contract now carries explicit bounds for strings, integers, arrays, and free-form maps so generated clients and validators can enforce safer limits without changing routes.
- The OpenAPI 3.1 document no longer uses the OpenAPI 3.0 nullability keyword; fields that may be null are represented with JSON Schema type arrays.
- Response contracts now describe the v2 handler shapes observed on live read endpoints.

**Changed**
- Added schema bounds across component and operation schemas: `maxLength`, `minimum`, `maximum`, integer `format`, `maxItems`, `maxProperties`, and bounded value schemas for intentional maps.
- Added optional `RateLimit` and `RateLimit-Policy` response header modeling alongside the v2 legacy rate-limit headers and `Retry-After`.
- Added optional `Deprecation` and `Sunset` response header components for the v2-to-v3 transition.
- Error responses keep `application/json` and also advertise `application/problem+json` where problem-shaped errors are supported, preserving JSON clients while documenting RFC 9457-compatible responses.

**Fixed**
- Corrected live response schemas for credit-handling thresholds, contact timestamps, permission options, documents, and orders.

---

## 2.4.9 (2026-07-13, non-breaking)

**Why**
- Customers and agents needed one front-door call for small groups of independent reads and guarded writes without creating an authorization shortcut.
- Batching must not amplify request capacity, bypass confirmation, or hide partial failures.

**Added**
- `POST /batch` (`submitBatch`) submits up to 25 live `/user-api/v2` sub-requests using the current route convention such as `/vm`, `/events`, `/event-subscriptions`, and `/account`.
- Batch responses preserve request order and echo each optional sub-request `id` for correlation.
- Each sub-request is best-effort and independent: a failing item returns its own status and problem details without rolling back successful siblings.

**Security**
- The batch wrapper requires `Idempotency-Key`; replaying the same key and body returns the cached `BatchResponse` without re-executing sub-requests.
- Each sub-request is dispatched through the same native guard chain as a standalone call: bearer scope, ownership, confirmation, rate accounting, and per-operation idempotency are all evaluated against the target operation.

**Changed**
- A batch of N sub-requests consumes N request-rate units, rejects nested `/batch`, and rejects 26 or more sub-requests.
- If any sub-request targets a confirmation-gated operation, the batch wrapper also requires `X-User-Api-Confirm` as an explicit acknowledgement; guarded sub-requests still require their own `confirm` value.

---

## 2.4.8 (2026-07-13, non-breaking)

**Why**
- Customers and agents needed push delivery for the existing event feed without polling loops.
- Webhook push is outbound-sensitive, so registration and delivery both enforce public HTTPS-only egress and never follow redirects.
- Delivery authenticity must be verifiable by receivers without exposing internal implementation details.

**Added**
- `POST /event-subscriptions` (`createEventSubscription`) creates a customer-owned webhook subscription for matching CloudEvents. It requires `Idempotency-Key`, returns the HMAC signing secret only in the first `201` response, and returns `200` without the secret on idempotent replay.
- `GET /event-subscriptions` (`listEventSubscriptions`) lists owned subscriptions without returning secrets.
- `GET /event-subscriptions/{eventSubscriptionId}` (`getEventSubscription`) reads one owned subscription; cross-customer ids return not found.
- `DELETE /event-subscriptions/{eventSubscriptionId}` (`deleteEventSubscription`) deletes one owned subscription and stops future delivery attempts.

**Security**
- Subscription targets must be standard-port `https` URLs on public hosts. Registration and delivery reject loopback, private, link-local, metadata, `.local`, non-HTTPS, non-standard-port, and DNS-rebound targets.
- Each delivery is a CloudEvents JSON body signed with `X-SHC-Webhook-Signature: sha256=<hex>` using HMAC-SHA256 over the exact raw body bytes. Receivers should compare signatures in constant time.

**Changed**
- Delivery is asynchronous and at least once. Each attempt carries an event id and a delivery id so receivers can dedupe; retries use bounded backoff and exhausted attempts are recorded in a dead-letter store.

---

## 2.4.7 (2026-07-13, non-breaking)

**Why**
- Customer cloud-init needed a safe self-service path where callers provide only cloud-init content, never host paths, storage selectors, filenames, shell fragments, or host-side transport details.
- The safe transport is a server-managed cloud-init CD-ROM built from the submitted user-data and attached as the VM's single cloud-init source.
- Validation is separate from apply so customers and agents can prove the payload is `#cloud-config` before any VM attachment. Apply is idempotency-before-confirm, so retrying a confirmed request cannot double-attach or drift state.

**Added**
- `POST /vm/{serviceId}/cloud-init/validate` (`validateVirtualMachineCloudInit`) validates customer `#cloud-config` content and reports the derived NoCloud seed contract without touching the VM.
- `PUT /vm/{serviceId}/cloud-init` (`updateVirtualMachineCloudInit`) confirm-gates the ISO build/attach path. It accepts cloud-init content only, builds the NoCloud ISO server-side, attaches it as the single CIDATA source, and returns the derived attachment metadata.
- `DELETE /vm/{serviceId}/cloud-init` (`deleteVirtualMachineCloudInit`) confirm-gates detach and cleanup of the managed ISO, leaving unrelated disks and ISOs untouched.

**Security**
- Callers provide cloud-init content only. Host paths, storage selectors, filenames, shell fragments, and host-side transport details are never request fields.
- Detach and cleanup affect only the managed cloud-init media and leave unrelated disks and media untouched.

---

## 2.4.6 (2026-07-13, non-breaking)

**Why**
- Customer-owned automation needed native short-lived agent identity instead of reusing account passwords or full API keys.
- The proof-of-possession design binds each session to a Nostr public key and exact request method/URL, which gives agents scoped access without broad credential custody.

**Added**
- Native agent session identity operations are live: `createAgentSession`, `listAgentSessions`, `getAgentSession`, `revokeAgentSession`, and `listAgentSessionAudit`.
- `createAgentSession` mints a customer-owned `shc_agent_` bearer token. `Idempotency-Key` is required and the plaintext token is returned once.
- Agent sessions are Nostr proof-of-possession bound. Every session bearer request must include `X-User-Api-Agent-Proof` with a NIP-98 kind 27235 event signed by the session public key and bound to the exact request method and URL.
- Agent session scope is `read` or `operate`.
- Agent session audit records are customer-readable, attributed by sessionId and agentId, traceparent-aware, and carry tamper-evident hashes under `data.tamperEvidence`.

**Security**
- Read sessions are GET-only.
- Operate sessions still cannot manage keys, passwords, 2FA, account identity, billing money movement, contacts, managers, or agent-session material.
- `revokeAgentSession` is confirmation-gated. An unconfirmed revoke returns 409 and does not revoke; a confirmed revoke invalidates the session immediately.

---

## 2.4.5 (2026-07-13, non-breaking)

**Why**
- Customers and agents needed a single owned activity stream for lifecycle, billing, order, and payment facts instead of scraping unrelated UI pages or operator-only logs.
- The feed is read-only and domain-scoped: API audit events stay separate, while business events are normalized into a stable CloudEvents shape.

**Added**
- `GET /events` (`listEvents`), a read-scoped, customer-owned CloudEvents feed for business-domain activity.
- The feed is cursor-paginated and supports `limit`, `cursor`, and `virtualMachineId`.
- Lifecycle rows, owned service lifecycle/status changes, invoice created/paid events, order created events, and customer payment events are normalized into the `CloudEvent` response shape.

**Changed**
- API audit events remain separate and are not emitted by this operation.
- Response bodies expose `items`, `nextCursor`, and `links`; `links.self` and `links.next` preserve the active query parameters for stable cursor round-trips.

---

## 2.4.4 (2026-07-13, non-breaking)

**Why**
- Owned VM lifecycle needed a reversible park/resume lane instead of forcing customers into cancellation or support tickets when they wanted to stop spend and later resume.
- The design keeps the action customer-scoped and test-safe: preview is read-only, standby/resume are confirm-gated, and idempotency protects retries.

**Added**
- `GET /vm/{serviceId}/standby/preview` (`previewVirtualMachineStandby`), a read-only quote returning keep-IP and release-IP recurring/credit figures plus `keep_ip_delta`.
- `POST /vm/{serviceId}/standby` (`standbyVirtualMachine`), a confirm-gated operate-scoped lifecycle write.
- `POST /vm/{serviceId}/resume` (`resumeVirtualMachine`), a confirm-gated operate-scoped lifecycle write returning active state plus `resume_charge`.

**Changed**
- Standby accepts an optional body `{ "keep_ip": boolean }` with default `false`, requires `Idempotency-Key`, and returns parked state, `standby_recurring`, `park_credit`, and `ip_disposition`.
- The first unconfirmed standby/resume call returns 409 `confirmation_required`.
- Execute a confirmed standby/resume by re-sending the byte-identical request with the same `Idempotency-Key` and `X-User-Api-Confirm`.
- Same key plus same body replays the cached response; same key plus a different body returns 422 `idempotency_key_conflict`.

---

## 2.4.3 (2026-07-11, non-breaking)

**Why**
- The `/user-api/v2` public contract had to reflect live wire behavior exactly, including lowerCamelCase path/query parameters and snake_case body fields, so REST and MCP callers could use the same truth.
- Several live operations were not fully represented in the public OpenAPI and MCP surfaces; this release closed that parity gap without changing live wire behavior.

**Added**
- Public-contract parity operations for orders, client documents/downloads, Nostr identity link/NIP-05/unlink, support attachment/feedback, electronic invoices, contact and manager updates, VM term options/preview/commit, and quotation approval.
- MCP path-argument coverage for `updateContact` with `{contactId}` and `updateAccountManager` with `{ref}`.
- Agent docs clarify that `llms.txt` is a lean agent primer plus operation index, while full per-operation parameters, request bodies, responses, and examples live in `docs/operations.md`.

**Changed**
- Request contracts use the live wire names: path parameters keep lowerCamelCase names such as `serviceId`, `invoiceId`, `ticketId`, `contactId`, and `orderId`; request body fields use the live `/v2` snake_case names such as `pricing_id`, `idempotency_key`, `first_name`, `nip05_name`, and `rating_comment`.
- Query parameters keep their live contract names, including `getInvoiceElectronic` string `format`, `listClientDocuments` `sort`/`order` enums, and `listDownloadFiles` `category_id`.
- Confirm metadata marks exactly the confirmation-gated operations, and idempotency placement matches the route contract.
- MCP exposure is clarified: default `tools/list` returns curated tools, `X-MCP-Tools: all` returns the full tool set, and binary-response additions remain REST-only.

**Fixed**
- `cancelPendingOrder` accepts no request body.
- Empty JSON objects are preserved as `{}` instead of being round-tripped to `[]`.

---

## 2.4.2 (2026-07-11, non-breaking)

**Why**
- Customers needed to add service options and renew an existing VM from the same self-service API surface without duplicating invoices on retries.
- The commit operations intentionally use body `idempotency_key`, matching pay and upgrade conventions, because they create billing artifacts.

**Added**
- Existing-service add-ons: `GET /vm/{serviceId}/addons` (`listServiceAddons`), `GET /vm/{serviceId}/addons/options` (`getServiceAddonOptions`), `POST /vm/{serviceId}/addons/preview` (`previewServiceAddon`), and `POST /vm/{serviceId}/addons` (`createServiceAddon`).
- `createServiceAddon` is a confirm-gated spend: send `X-User-Api-Confirm` after the two-step challenge, body carries `idempotency_key`, and it returns the pending add-on service plus its invoice checkout pointer.
- Service renewal commit: `POST /vm/{serviceId}/renew` (`submitVirtualMachineRenewal`), a confirm-gated spend with body `idempotency_key`.
- Optional `pricing_id` renews into a different term when the account permits term changes; otherwise the current term is renewed.

**Changed**
- Both new spend operations use the same body `idempotency_key` convention as pay and upgrade.
- Same-key retries replay the original result; they never create a duplicate invoice.

---

## 2.4.1 (2026-07-02, non-breaking)

**Why**
- Request-body contracts and the MCP body convention were real server behavior but were not visible enough in the public docs, forcing integrators to infer field names and tool argument shape.
- The release made the contract explicit without changing operationIds, paths, required-field sets, request/response shapes, or enums.

**Added**
- Every operation that accepts a request body now carries a complete `requestBody` schema and a realistic example in `openapi.json`.
- A root `x-mcp-argument-convention` extension and `/user-api/docs/mcp-argument-convention.md` state how MCP tool arguments map onto REST: path/query parameters are top-level tool arguments, the entire request body is a single nested `body` object, and the only header tool argument is `Idempotency-Key`.
- A per-operation `x-shc-id-placement` extension documents the intentional ID-placement asymmetry: firewall rules take the rule id as a path parameter (`pos`, no body); backups and snapshots take the id as a body field (`backup_id`, with `snapshot_id`/`id` accepted as aliases).
- A complete per-operation request reference in the docs page covers all public operations.

**Changed**
- `info.version` changed from `2.4.0` to `2.4.1` as a documentation-only patch bump.

---

## 2.4.0 (2026-07-02, non-breaking)

**Why**
- The public 2.4 contract needed stable machine-readable errors, UTC timestamps, richer VM summaries, cancellation-credit mirrors, and agent/MCP result consistency so customers could automate against facts instead of screen text.

**Fixed**
- Missing-VM lookups on `GET /vm/{service_id}/detail` and `POST /vm/{service_id}/ssh-keys/apply-live` return 404 with `error_code: not_found` instead of 500.
- `GET /vm/{service_id}/summary` includes the live `runtime` object with state, lock, CPU percent, and memory percent; it may be null when the provider read is unavailable.
- All timestamps are true UTC. Date fields such as `date_created` and `date_renews` no longer emit the prior five-hour offset.
- `GET /vm/{service_id}/activity` shows the VM's own provisioning tasks.
- Orders that cannot resolve an OS template are rejected up front with 422 `template_required`, and package-mismatched `config_options` are rejected with valid option IDs.
- API responses begin with JSON; the stray plaintext banner line is gone.

**Added**
- `error.error_code` on every error, with transient retry guidance in `error.retry_after_seconds`.
- 409 confirmation challenges mirror the non-secret ID at `confirmation.confirmation_id`.
- Field aliases are dual-emitted or accepted where written: `balances`/`credit`, `items`/`upgradable`, singular `service_id`, snapshot/backup aliases, and `pricing_id`/`pricing_ref`.
- Cancel responses include top-level `expected_refund` and `transaction_id` from the same customer-visible cancellation-credit model as the portal.
- Firewall `action` is case-insensitive on input; `GET /ssh-key` accepts `?service_id=`; `POST /vm/{service_id}/console/session` accepts optional `ttl` clamped to 5-300 seconds.
- `POST /agent-keys/claim` is documented.
- MCP returns `structuredContent.result` on every tool result, includes a `listApiKeys` metadata-only tool for full-scope keys, supports legacy tool-name aliases, and stamps `serverInfo.catalog`.
