publ betaReference (MCP guide)
Open publ console

media_live_apply

# media_live_apply

Change supported live-event information, configure already installed event-live subtitle packs or maintain C00014 external product cards. The required-image creation option below exists in domain source but awaits common host integration. It does not start/end a broadcast or purchase/install extensions.

## Inputs and actions

Provide channelCode, exact pAppCode (`C00005`, `C9xx05`, `C00014`), action, expectedRevision from the matching [media_live_get](media_live_get.md) view, requestId and optional dryRun (default false).

For `action.kind:info`, provide a nonempty changes object. Event-live accepts title (1–100 characters), description (up to 20000), nonnegative safe integer ageRating, descriptionVisible and mobileTitleVisible. Commerce-live accepts title and mobileTitleVisible only. Omitted fields retain their current values.

For `action.kind:subtitles`, provide unique packs (at most three), preferredLanguage and display. This action supports C00005/installed instances, not C00014. Pack choices are:

| pack | Source language set |
| --- | --- |
| `Z00011` | ko, en, ja, zh-CN, zh-TW |
| `Z00012` | ko, en, vi, th, tl |
| `Z00013` | ko, en, es, it, fr |

preferredLanguage is one of `ko-KR`, `en-US`, `ja-JP`, `zh-CN`, `zh-TW`, `es-ES`; these preference values are distinct from the pack-language identifiers. Adding a pack requires `confirmation:ACTIVATE_SUBTITLE_PACKS`. Packs must already be available to the installed app. Activation may consume its service entitlement and is not automatically reversible. Active packs cannot be removed. With no packs, display cannot be enabled or the current preferred language changed (ko-KR is used when none is stored).

The adapter requires a verified current CLEX01/live binding. Unsupported or unrepresented active zones fail rather than being silently discarded. Other extension records are checked for preservation; this does not claim preservation of every private CLEX01 field. Missing setup needs a human prerequisite action.

## Results and recovery

Info/subtitle and metadata-only existing-card dry runs return `MEDIA_LIVE_CONFIGURATION_PLAN`; creation and image replacement below have their own plan codes. Observations distinguish matching configuration from an unconfirmed write and retain `broadcastReadinessVerified:false`. No stream-key, broadcast start/end, rehearsal, chat or pack-purchase control is accepted.

Task type: `media-live`. Use the saved requestId as taskId with the matching taskType. Media `task_status` and `task_resume` are observation-only, including prepared work. Repeat identical apply to continue a prepared action or an acknowledged next unsent stage; never change requestId to bypass an uncertain sent operation. A matching readback does not prove causality, atomic isolation or restoration. See [recovery and revisions](../guides/media-workflows.md#recovery-and-revisions).

Read the [media workflow guide](../guides/media-workflows.md) for authorization, source-versus-runtime availability and common recovery rules.

## Input example

Illustrative input only. Replace the channel, installed app, identifiers and revision with values obtained for the selected target.

```json
{
  "channelCode": "selected-channel",
  "pAppCode": "C00005",
  "action": {
    "kind": "info",
    "changes": {
      "title": "Event"
    }
  },
  "expectedRevision": "0000000000000000000000000000000000000000000000000000000000000000",
  "requestId": "example-request-001",
  "dryRun": true
}
```

## C00014 external product card actions

Read view products first and use its revision. C00014 alone supports these actions; keep channelCode, pAppCode, requestId, expectedRevision and dryRun as above. For the original existing-card contract, change selects exactly one operation:

| change.operation | Fields |
| --- | --- |
| edit | Positive safe integer productId and nonempty changes: title, linkSrc, price and/or discountPrice. |
| visibility | productId and isOpen boolean. |
| order | productIds with every currently public card exactly once, 1–20 distinct positive IDs; hidden cards cannot be ordered. |
| remove | productId and confirmation REMOVE_PRODUCT. |

Title trims and accepts 1–200 UTF-16 units. linkSrc must be HTTP(S), at most 4096 characters, with no credentials or whitespace. price is the optional original display price; empty string clears it. discountPrice is required in stored cards and cannot be cleared. Both accept nonnegative safe integer strings, optionally correctly grouped with commas, at most 32 characters; no decimals. If an original price remains, the merged sale price must be strictly lower. These are bounded display strings, not currency conversion or backend checkout prices. Omitted fields are preserved. Title/link-only requests omit image and price payloads; price changes preserve other link-data fields.

Every target must be in the complete selected inventory. Fresh context/revision checks precede one PUT edit/visibility, POST order or DELETE remove. Edit/order/remove compare the full expected state and unchanged siblings. Visibility checks the target membership, preserved card data and other public cards' relative order; the source does not promise a newly public card's insertion position. Read openedProductIds and use a separate order action if needed. This is not an atomic transaction or causal proof.

Dry run is read-only with no journal. Sent work, including an uncertain DELETE, is never replayed by identical apply/status/resume. Recovery verifies removal from the full list without demanding the deleted detail. Removing an already absent card is not a new plan. There is no automatic recreation, rollback or batch action. The later required-image creation contract below extends this source scope. Internal SKU operations and billing remain outside it.

Plans require a typed products action and writesPerformed:false. Save/recovery results identify the surviving parent list, including an empty verified list after removal. No fresh collection means no uncertain-result link; a fresh mismatch may resolve the parent while preserving pending/currentStateMatches:false. Historical results and other apps/paths are rejected. [The reader](media_live_get.md#c00014-external-product-cards) explains the collection guards.

Illustrative edit plan; replace the observed productId and products revision:

```json
{
  "channelCode": "selected-channel",
  "pAppCode": "C00014",
  "requestId": "live-product-edit-001",
  "expectedRevision": "0000000000000000000000000000000000000000000000000000000000000000",
  "action": {
    "kind": "products",
    "change": {
      "operation": "edit",
      "productId": 1,
      "changes": {
        "title": "Featured notebook",
        "price": "2,000",
        "discountPrice": "1,500"
      }
    }
  },
  "dryRun": true
}
```

## C00014 card creation with original image

Use C00014, a fresh products-view revision, the same requestId and these fields inside change:

| Field | Requirement |
| --- | --- |
| operation | create. |
| title | Required trimmed 1–200 UTF-16 units. |
| linkSrc | Required HTTP(S) URL, at most 4096 characters, without credentials or whitespace. |
| discountPrice | Required sale display-price string under the existing safe nonnegative integer/comma rules. |
| price | Optional original display price; defaults to empty. When present and nonempty, sale price must be strictly lower. |
| isOpen | Optional boolean, default false (private). No guaranteed position if made public. |
| image | Required strict object with filename and canonical base64 of the original PNG/JPEG bytes. |

The complete inventory must have fewer than 20 cards before any grant request. Prices remain display text, not purchase/billing amounts. image.filename is a basename of 1–240 characters ending .png/.jpg/.jpeg, matching the bytes; paths, URLs, colons and control characters are refused. image.base64 has no data-URL prefix or whitespace. Decoded size must be 1–9,999,999 bytes: exactly 10,000,000 is rejected. PNG/JPEG container structure is checked and original bytes are hashed and preserved, without resizing, rewriting or pixel decoding. A URL, previous asset ID, object key or thumbnailSrc cannot replace the image. Existing host request-body limits still apply; this option does not raise ingress limits or create a hosted VOD picker.

With the connected host and valid preflight, dryRun returns MEDIA_COMMERCE_PRODUCT_CREATE_PLAN with planned card, image metadata and writesPerformed:false. It verifies configured storage, current context/state and the selected original image but issues no credentials, uploads no bytes and creates no journal. Hook presence alone, exposed by the reader's creationSupported flag, is not that verification.

The save sequence is prepared → image-sent → image-ready → create-sent in a separate creation mode under media-live. The host must supply explicitly configured RESOURCE_GATEWAY/bucket/region, authorize the exact installed C00014 consumer and issue one image credential under the original 200/201 response contract. One original-byte PUT must acknowledge the matching checksum before one LIVE card POST may use the issued image location. Storage/context/card state are rechecked between effects. There is no retry, redirect, multipart transfer, public-read probe or object deletion. An issued location already attached to an existing card is rejected before PUT.

Keep the original input, image bytes and taskId. The sent checkpoint is durable before each effect. Image metadata and acknowledged object identity are saved; raw bytes and temporary credentials are not. An uncertain credential or PUT stays image-sent and is never repeated. A durably acknowledged image-ready checkpoint may continue only through identical apply with the original image and unchanged context/storage/snapshot. Status/resume only observe, including prepared/image-ready work. Failed receipt persistence blocks the card POST and must not trigger reupload. Changing requestId is not a recovery strategy.

After POST, MEDIA_COMMERCE_PRODUCT_CREATED requires one new card with the exact issued image URL, requested title/link/visibility/prices, unchanged prior cards/app settings and prior public relative order. Matching title alone is insufficient; rewritten image URLs, duplicate image matches, wrong fields or sibling changes remain MEDIA_COMMERCE_PRODUCT_CREATE_UNCONFIRMED. A lost POST response uses observation only, never another POST. Inspect imageUploadAcknowledged, creationIdentityVerified, currentStateMatches and journalPersistence when present; an acknowledged image alone is not a created card. The creation journal can remain create-sent after a successful observation. No causal proof, visitor rendering, atomic transaction, orphan-image cleanup or automatic restoration is provided.

A fresh observation needs revision, imageUploadAcknowledged:true, the matching create-sent/update-sent phase and currentStateMatches. Success additionally needs the corresponding verified product identity and product projection. A fresh mismatch may expose that parent while remaining pending/currentStateMatches:false. Catch results without revision/current state, image-only checkpoints, historical results and foreign targets have no product link. No card-detail route is invented.

Replace it with the authorized original image and replace the channel/revision; this is not an upload record and requires configured storage and a matching current context:

```json
{
  "channelCode": "selected-channel",
  "pAppCode": "C00014",
  "requestId": "live-product-create-001",
  "expectedRevision": "0000000000000000000000000000000000000000000000000000000000000000",
  "action": {
    "kind": "products",
    "change": {
      "operation": "create",
      "title": "Featured notebook",
      "linkSrc": "https://shop.example.invalid/notebook",
      "price": "2,000",
      "discountPrice": "1,500",
      "isOpen": false,
      "image": {
        "filename": "example.png",
        "base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+aDWQAAAAASUVORK5CYII="
      }
    }
  },
  "dryRun": true
}
```

## Replace an existing C00014 card image

Use change:{operation:"edit",productId,changes:{image:{filename,base64},title?,linkSrc?,price?,discountPrice?}} with the ordinary products revision. An image-only edit is allowed. Omitting image keeps ordinary metadata editing; create still requires its image and keeps isOpen:false by default.

The same original PNG/JPEG basename, canonical base64 and 1–9,999,999-byte rules apply. Null/empty image, URL, asset ID or object key is not a replacement. Unlike creation, replacement can run with all 20 card slots occupied. imageReplacementSupported only reports whether both existing image hooks exist; it does not prove valid storage or actual operation. A host without the hooks still returns MEDIA_PRODUCT_IMAGE_HOST_UNAVAILABLE before mutation; a connected host requires valid RESOURCE_GATEWAY/bucket/region and fresh context, including dry run.

With those dependencies satisfied, MEDIA_PRODUCT_IMAGE_EDIT_PLAN validates target, requested fields, original bytes and configuration without a journal, grant, upload or card save. The acknowledged upload uses a newly issued location distinct from every current card image, including the target. It never overwrites the old key, deletes the old object or fetches an arbitrary image URL. An image-only card PUT contains thumbnailSrc; optional metadata uses the existing preservation rules and price changes retain extra link data.

The separate commerce-product-image-edit mode keeps taskType media-live with prepared → image-sent → image-ready → update-sent. Sent stages are saved before effects. Persist image metadata, bound context/storage, previous image hashes and expected-state hash, never original bytes, credentials or raw sibling data. Uncertain grants/PUTs never replay. Only identical apply with the original bytes/fields/target and unchanged context/storage/snapshot can continue a durably acknowledged image-ready checkpoint; status/resume never continue it. Failed image receipt persistence blocks card PUT/reupload.

MEDIA_PRODUCT_IMAGE_REPLACED requires the exact issued image and requested fields with original visibility, other metadata, siblings and public order preserved. Rewritten URLs or other changes remain MEDIA_PRODUCT_IMAGE_EDIT_UNCONFIRMED, including after receipt loss; the card PUT is never repeated. Inspect imageUploadAcknowledged, imageIdentityVerified and currentStateMatches independently. Dynamic updatedAt/numeric order retain their earlier exclusion. Old objects and orphaned new uploads have no automatic cleanup or restoration. To restore an image, retain its original bytes and perform a separately authorized new image-edit request with a fresh products revision; this uploads a new object rather than restoring or deleting an old key.

```json
{
  "channelCode": "selected-channel",
  "pAppCode": "C00014",
  "requestId": "live-product-image-001",
  "expectedRevision": "0000000000000000000000000000000000000000000000000000000000000000",
  "action": {
    "kind": "products",
    "change": {
      "operation": "edit",
      "productId": 1,
      "changes": {
        "image": {
          "filename": "replacement.png",
          "base64": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+aDWQAAAAASUVORK5CYII="
        }
      }
    }
  },
  "dryRun": true
}
```

## Product history has no edit revision

The object view reports source statistics strings and no configuration revision. Continue to use the products view revision with this writer. historySupported in products metadata describes only hook presence. An absent explicit analytics origin leaves the hook unavailable.