media_post_apply
Create course text/coaching sessions or change supported metadata, publication, shorts labels or deletion of existing media posts.
Inputs and actions
Provide channelCode, pAppCode (C00001, C00002, C00006, C00007, C00015), action, expectedRevision, requestId and optional dryRun (default false). Use media_posts_get creationRevision for new sessions and detail revision for ordinary existing-post actions. Use the separate conversion-link view revision for the action below. The authenticated channel profile must own an existing target. Coaching actions require the installed course extension Z00004.
| action.kind | Fields |
|---|---|
create-text |
title, contentHtml, optional introduction (default empty), ageRating (default 0); C00007 only |
create-coaching |
title, coaching, notifications none, optional ageRating (default 0); C00007 only |
edit |
postId, nonempty changes described below |
publication |
postId, isPublished |
labels |
postId, unique labelIds (0–100); C00015 only, empty clears associations |
delete |
postId, confirmation DELETE_MEDIA_POST |
conversion-link |
C00015 only; postId, operation create/edit and edit-only changes described below. |
New text/coaching sessions are unpublished. Coaching uses a ZOOM service link; it does not create a meeting or send notifications. The coaching object contains an HTTP(S) link without credentials (up to 4096 characters), startsAt with an explicit timezone and whole seconds, and positive safe integer durationMinutes. The start must be in the future on a five-minute UTC boundary (zero seconds and a minute divisible by five). Changing an existing coaching time requires no active scheduled tasks and the supported existing ZOOM service.
Edit fields are title, description, introduction, contentHtml, ageRating, publishedAt and coaching, each restricted to the selected post/app. Nonblank title limits are 50 for OTT, 60 for serial and 100 otherwise. Description is for VOD except shorts, up to 200 for OTT or 5000 otherwise. introduction (up to 250) and contentHtml (2–30000) apply only to text sessions. ageRating is an integer from 0 to 10000000. publishedAt is supported only by basic VOD, serial and shorts; supply an offset-qualified whole-second instant. It is stored publication metadata, not a future-publication task.
Publishing VOD requires an attached VOD resource; this is not a playback check. Shorts labels must come from the same app's GENERAL category in media_labels_get. Video upload, collection connections and timed publication use their separate operations.
Results and recovery
Dry run returns MEDIA_RESOURCE_PLAN. Apply dispatches at most the selected write and performs fresh projected readback. currentStateMatches concerns the observed resource; causalityVerified:false remains explicit. writesPerformedThisCall:false on observation means that call did not write, not that the original attempt never did. A dispatched attempt can report writeRequestAttemptedThisCall:true with an unknown write count.
Created-resource receipt identity is required; ambiguous creation is not reconciled by title. Delete checks detail 404 plus complete stable post-list absence within 5000 posts. Preservation covers the represented post fields, labels/assets and active schedules, not every unknown backend field. There is no general undo or deleted-post restoration.
Task type: media-post. 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.
Read the media workflow guide 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.
{
"channelCode": "selected-channel",
"pAppCode": "C00007",
"action": {
"kind": "edit",
"postId": 1,
"changes": {
"title": "Lesson"
}
},
"expectedRevision": "0000000000000000000000000000000000000000000000000000000000000000",
"requestId": "example-request-001",
"dryRun": true
}
Shorts conversion-link creation and editing
Read the dedicated view and copy its revision into expectedRevision. The selected post must belong to the authenticated channel profile.
operation:create requires postId and forbids changes. It sends an empty object to initialize an explicitly missing link and refuses an existing one. The returned server record supplies its original defaults; creation neither accepts requested fields nor guarantees a valid title, destination, enabled state or visitor behavior. Read again and perform a separate edit when configuration is needed.
operation:edit requires postId and nonempty changes:
| changes field | Contract |
|---|---|
| title | Trimmed, required nonblank when supplied, at most 30 UTF-16 units. |
| description | At most 50 units; empty clears it. |
| linkType | INTERNAL_LINK or WEB_LINK. |
| destinationUrl | HTTP(S), at most 4096 characters, without credentials or whitespace. |
| enabled | Boolean mapped to the inverse isDisabled. |
| clearThumbnail | Literal true maps to thumbnailSrc:""; no image URL or upload input. |
The final merged record must have a valid title, description and destination even if editing only enabled or clearing a thumbnail. For INTERNAL_LINK, the URL path must start with the exact /channels/<selected-channel-code> segment; this is stricter than the original substring check and does not verify host ownership or reachability. No destination is fetched. Link presentation type BANNER/BUTTON, image replacement, history and link deletion are unsupported.
The existing API post conversion-link endpoint uses the exact installed consumer. POST must return a postConversionLink for the selected post; its exact string distinctId is durably saved as receiptIdentity alongside the numeric post receipt. Creation succeeds only when a fresh observation matches that returned identity and preserves the original post. Losing the response or durable identity stays pending even if a link is now visible. Never adopt by title or merely by existence, and never resend a sent POST/PUT or switch requestId to bypass uncertainty.
Edit sends only requested source fields and preserves stable distinctId/type/insertedAt, unknown link metadata and represented post publication/resource/attachment/label fields. Dynamic updatedAt remains excluded. Dry run exposes post, public link/null and initialized without a journal or write. Existing numeric resource journals remain compatible. Status/resume only observe, including prepared work; identical apply may continue genuinely unsent prepared work. No automatic rollback, causal proof or atomic compare-and-swap is established.
It admits only the exact C00015 shorts/:postId/conversion-link/start or information route matching the current post, consumer/installation, link postId and initialized state. A validated creation dry-run plan still opens start. Reads and fresh sent/done observations require a revision; a fresh mismatched observation may identify the current screen while remaining pending. Prepared tasks, catch results without an observation, historical results and foreign or guessed targets have no link. Navigation cannot recover a missing creation identity or permit a resend.
Illustrative plans only; replace post/channel and the dedicated view revision. Creation and editing are separate requests, and the edit needs a new read after creation.
{
"channelCode": "selected-channel",
"pAppCode": "C00015",
"action": {
"kind": "conversion-link",
"postId": 1,
"operation": "create"
},
"expectedRevision": "0000000000000000000000000000000000000000000000000000000000000000",
"requestId": "shorts-link-create-001",
"dryRun": true
}
{
"channelCode": "selected-channel",
"pAppCode": "C00015",
"action": {
"kind": "conversion-link",
"postId": 1,
"operation": "edit",
"changes": {
"title": "Explore more",
"description": "",
"linkType": "WEB_LINK",
"destinationUrl": "https://example.invalid/collection",
"enabled": true,
"clearThumbnail": true
}
},
"expectedRevision": "0000000000000000000000000000000000000000000000000000000000000000",
"requestId": "shorts-link-edit-001",
"dryRun": true
}
History is not a write revision
The page contains impression/click counts and no mutation revision. Read conversion-link separately for the revision required by this writer. History reading performs no initialization, save or visitor action. The earlier start/information projection remains separate. Actual history/console comparison and visitor behavior remain unverified.