Update an existing app

Storage survives updates. Existing contracts retain synchronous PUT and optional If-Match. ESM saves require Idempotency-Key and If-Match carrying the current desired source revision; accepted source advances desired while active remains the last working build. Omitting ui/styles preserves desired values only for ESM; null clears. Successful builds publish automatically; later saves supersede pending builds.

put/app/{id}

Request

  • Base URL: https://charm.ing
  • URL: https://charm.ing/app/{id}
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Headers

Idempotency-Keystring

Required for ESM saves. Reuse the same key, body, target and If-Match after response loss; a changed request with that key returns idempotency_conflict. Use a fresh key for each intentional save.

If-Matchstring

Validator "<N>" for revision N from desired GET /app/:id/source. Required for ESM saves and migrations; optional for existing-contract PUT. The weak form W/"<N>" is also accepted so clients can return the response ETag verbatim.

Request body

modulestring required

Replacement server ES module source. Must export a literal canonical manifest and a routes array. A route handler returns exactly the value declared by outputSchema; for outputSchema: { type: "array", items: ... }, return the array directly. Charming adds the HTTP transport envelope, so do not add { ok, value } or { value } unless those fields belong to outputSchema itself. default.fetch is an optional unmatched-request fallback; when absent, Charming supplies a generic 404 handler. Keep the stored contract’s exact schema. ESM source is statically checked and built after acceptance.

uistring nullable

ESM browser module: omit to preserve desired UI, pass null to clear. Existing-contract PUT retains replacement semantics.

stylesstring nullable

ESM: omit to preserve desired styles, pass null to clear.

descriptionstring nullable

Omit to preserve the desired description; pass null to clear.

migrate_contractboolean

Required as true when changing a stored contract. ESM migration requires the explicit ESM schema, Idempotency-Key and desired-source If-Match; it publishes only after a successful build. Source submissions do not roll back contracts. History can explicitly restore a retained validated existing-contract revision.

Response

Updated

idstring uuid required
manifestIdstring required
displayNamestring required
descriptionstring nullable
urlstring uri required
capabilitiesCapabilities required(unresolved $ref)
claimedboolean required
revisioninteger required

Server-owned app source revision. New apps start at 1, each successful source write advances it once, and historical null counters project as 0. If-Match: "<N>" and expected_revision carry this revision through its canonical concurrency grammar.

warningsstring[]

Non-blocking publish feedback (#1126), present only when static validation found UI/backend contract mismatches. The write succeeded.

Changes

No recorded changes to this operation across all 1 revision of this API.