> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# UpdateMarketingActivityStoriesMedia

# Package: marketingPlan

# Namespace: AiPlanGeneratorService

# Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/marketing-plan/marketing-plan-v1/update-marketing-activity-stories-media.md

## Permission Scopes:
Manage Marketing Plans: SCOPE.PROMOTE.MANAGE-MARKETING-PLAN

## Introduction

Updates the media on a marketing activity's story drafts with the provided media URL,
leaving its post drafts unchanged.

A story draft holds one media item per frame, up to 5 frames. Specify `mediaIndex` to replace a
single frame, or omit it to replace the whole story with the one new media item. A story that has
no frame at that index is left unchanged.

---

## REST API

### Schema

```
 Method: updateMarketingActivityStoriesMedia
 Description: Updates the media on a marketing activity's story drafts with the provided media URL, leaving its post drafts unchanged.  A story draft holds one media item per frame, up to 5 frames. Specify `mediaIndex` to replace a single frame, or omit it to replace the whole story with the one new media item. A story that has no frame at that index is left unchanged.
 URL: https://www.wixapis.com/promote/marketing-plan-service/v1/marketing-plan/update-marketing-activity-stories-media
 Method: PATCH
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  marketingActivityId, mediaUrl, mediaType
 Method parameters: 
   param name: fileId | type: fileId | description: Media Manager file GUID backing the media, when the media originates from the Media Manager.  | validation: maxLength 1000
   param name: marketingActivityId | type: marketingActivityId | description: GUID of the marketing activity whose story drafts will have their media replaced. | required: true | validation: format GUID
   param name: mediaIndex | type: mediaIndex | description: Optional 0-based index of the story frame to replace. When omitted, the story's entire media set is replaced with the single new media. Stories that have no frame at this index are left unchanged.  | validation: format int32
   param name: mediaType | type: MediaType   | required: true 
      - enum:
           IMAGE - 
           VIDEO - 
   param name: mediaUrl | type: mediaUrl | description: URL of the media to apply to the activity's stories. | required: true | validation: maxLength 2048, format WEB_URL
 Return type: UpdateMarketingActivityStoriesMediaResponse
  - name: marketingActivity | type: SocialPlanMarketingActivity | description: The marketing activity with its updated media applied.  
     - name: marketingActivityId | type: string | description: Marketing activity GUID.  | read-only: true | validation: format GUID
     - name: date | type: string | description: Scheduled date of the marketing activity.  | validation: format date-time
     - name: items | type: array<Item> | description: Posts associated with this activity. Items can be of any status (`DRAFT`, `SCHEDULED`, or published). Only items whose `status` is `DRAFT` can be scheduled with `ScheduleDrafts`.  | validation: minItems 0, maxItems 10
        - ONE-OF: 
           - name: instagramPost | type: InstagramPost | description: Instagram post content.  
              - ONE-OF: 
                 - name: imageUrl | type: string | description: The image URL.  
                 - name: videoUrl | type: string | description: The video URL.  
                 - name: mediaWrapper | type: MediaWrapper | description: The media list.  
                    - name: media | type: array<Media> | description: List of media items.  
                       - name: type | type: MediaType | description: Media type.  
                                 - enum: IMAGE, VIDEO
                       - name: url | type: string | description: Media URL.  | validation: format WEB_URL
                       - name: fileId | type: string | description: Media Manager file GUID backing the media. Available only when the media is stored in the Media Manager.  | validation: maxLength 1000
              - name: caption | type: string | description: Caption for the post. Can include hashtags (for example, `#crazywildebeest`) and mentions of Instagram users (for example, `@natgeo`). Mentioned users are notified when the post is published. Supports up to 30 hashtags and 20 mentions.  | validation: maxLength 2200
              - name: postUrl | type: string | description: The post URL on Instagram.  | read-only: true 
              - name: insights | type: InstagramInsights | description: Insights from Instagram.  | read-only: true 
                 - name: likes | type: integer | description: Number of likes.  
                 - name: engagement | type: integer | description: Number of engagements.  
                 - name: impressions | type: integer | description: Number of impressions.  
                 - name: plays | type: integer | description: Number of plays.  
                 - name: reach | type: integer | description: Number of accounts reached.  
                 - name: comments | type: integer | description: Number of comments.  
                 - name: shares | type: integer | description: Number of shares.  
                 - name: saved | type: integer | description: Number of saves.  
                 - name: totalInteractions | type: integer | description: Total number of interactions.  
           - name: instagramStory | type: InstagramStory | description: Instagram story content.  
              - name: storyUrl | type: string | description: The story URL on Instagram.  | read-only: true | validation: format WEB_URL
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
              - name: insights | type: InstagramStoryInsights | description: insights data from Instagram.  | read-only: true 
                 - name: impressions | type: integer | description: Number of impressions.  
                 - name: reach | type: integer | description: Number of accounts reached.  
                 - name: replies | type: integer | description: Number of replies.  
           - name: facebookPost | type: FacebookPost | description: Facebook post content.  
              - ONE-OF: 
                 - name: imageUrl | type: string | description: The image URL.  
                 - name: videoUrl | type: string | description: The video URL.  
                 - name: link | type: string | description: The link URL.  
                 - name: mediaWrapper | type: MediaWrapper | description: The media list.  
              - name: pageId | type: string | description: The page GUID to publish the post to.  
              - name: caption | type: string | description: Caption for the post.  
              - name: postUrl | type: string | description: The post URL on Facebook.  | read-only: true 
              - name: linkMetadata | type: LinkMetadata | description: Link preview metadata. Available only when the post contains a link.  
                 - name: thumbnailUrl | type: string | description: Thumbnail URL for the link preview.  
                 - name: title | type: string | description: Title for the link preview.  
                 - name: description | type: string | description: Description for the link preview.  
              - name: insights | type: FacebookInsights | description: Insights from Facebook.  | read-only: true 
                 - name: impressions | type: FacebookImpressions | description: Impression counts.  
                    - name: unique | type: integer | description: Number of unique impressions.  
                    - name: total | type: integer | description: Total number of impressions.  
                 - name: interactions | type: FacebookInteractions | description: Interaction counts.  
                    - name: unique | type: integer | description: Number of unique interactions.  
                    - name: total | type: integer | description: Total number of interactions.  
                 - name: reactions | type: FacebookReactions | description: Reaction counts.  
                    - name: like | type: integer | description: Number of "like" reactions.  
                    - name: love | type: integer | description: Number of "love" reactions.  
                    - name: wow | type: integer | description: Number of "wow" reactions.  
                    - name: haha | type: integer | description: Number of "haha" reactions.  
                    - name: sad | type: integer | description: Number of "sad" reactions.  
                    - name: anger | type: integer | description: Number of "angry" reactions.  
                 - name: activity | type: FacebokActivity | description: Activity counts.  
                    - name: share | type: integer | description: Number of shares.  
                    - name: like | type: integer | description: Number of likes.  
                    - name: comment | type: integer | description: Number of comments.  
                 - name: updatedDate | type: string | description: Date and time the insights were last updated.  | validation: format date-time
           - name: facebookReel | type: FacebookReel | description: Facebook reel content.  
              - name: pageId | type: string | description: The page GUID to publish the reel to.  
              - name: videoUrl | type: string | description: The video URL.  
              - name: description | type: string | description: A description for the reel.  
              - name: insights | type: FacebookInsights | description: Insights from Facebook.  | read-only: true 
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
           - name: facebookStory | type: FacebookStory | description: Facebook story content.  
              - name: pageId | type: string | description: The page GUID to publish the story to.  | validation: maxLength 1024
              - name: storyUrl | type: string | description: The story URL on Facebook.  | read-only: true | validation: format WEB_URL
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
              - name: insights | type: FacebookInsights | description: Insights from Facebook.  | read-only: true 
           - name: youtubeVideo | type: YouTubeVideo | description: YouTube video content.  
              - name: channelId | type: string | description: The channel GUID to publish the video to.  
              - name: videoUrl | type: string | description: The video URL.  
              - name: title | type: string | description: A title for the video.  
              - name: description | type: string | description: A description for the video.  
              - name: categoryId | type: string | description: A category for the video.  
              - name: notifySubscribers | type: boolean | description: Whether to notify channel subscribers when the video is published.  
              - name: insights | type: YoutubeInsights | description: Insights data from YouTube.  | read-only: true 
                 - name: views | type: integer | description: Number of views.  
                 - name: comments | type: integer | description: Number of comments.  
                 - name: likes | type: integer | description: Number of likes.  
                 - name: dislikes | type: integer | description: Number of dislikes.  
                 - name: shares | type: integer | description: Number of shares.  
                 - name: updatedDate | type: string | description: Date and time the insights were last updated.  | validation: format date-time
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
           - name: youtubeShort | type: YouTubeShort | description: YouTube short content.  
              - name: channelId | type: string | description: The channel GUID to publish the short to.  
              - name: videoUrl | type: string | description: The short URL.  
              - name: title | type: string | description: A title for the short.  
              - name: description | type: string | description: A description for the short.  
              - name: categoryId | type: string | description: A category for the short.  
              - name: notifySubscribers | type: boolean | description: Whether to notify channel subscribers when the short is published.  
              - name: insights | type: YoutubeInsights | description: Insights data from YouTube.  | read-only: true 
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
           - name: linkedinPost | type: LinkedinPost | description: LinkedIn post content.  
              - ONE-OF: 
                 - name: imageUrl | type: string | description: The image URL.  
                 - name: videoUrl | type: string | description: The video URL.  
                 - name: link | type: string | description: The link URL.  
                 - name: mediaWrapper | type: MediaWrapper | description: The media list.  
              - name: authorId | type: string | description: Author GUID of the post. Can be an organization page or a personal feed.  
              - name: caption | type: string | description: Caption for the post.  
              - name: linkMetadata | type: LinkMetadata | description: Link preview metadata. Available only when the post contains a link.  
              - name: insights | type: LinkedinPostInsights | description: Insights from LinkedIn.  | read-only: true 
                 - name: uniqueImpressions | type: integer | description: Number of unique impressions.  
                 - name: impression | type: integer | description: Total number of impressions.  
                 - name: shares | type: integer | description: Number of shares.  
                 - name: engagement | type: float | description: Engagement rate.  
                 - name: clicks | type: integer | description: Number of clicks.  
                 - name: likes | type: integer | description: Number of likes.  
                 - name: comments | type: integer | description: Number of comments.  
                 - name: updatedDate | type: string | description: Date and time the insights were last updated.  | validation: format date-time
           - name: pinterestPost | type: PinterestPost | description: Pinterest post content.  
              - name: boardId | type: string | description: The board GUID to publish the post to.  | validation: maxLength 128
              - name: title | type: string | description: The title of the post.  | validation: maxLength 100
              - name: description | type: string | description: The description of the post.  | validation: maxLength 800
              - name: link | type: string | description: The link to include in the post.  | validation: maxLength 2048
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
              - name: insights | type: PinterestInsights | description: Insights from Pinterest.  | read-only: true 
                 - name: impressions | type: integer | description: Number of impressions.  
                 - name: clicks | type: integer | description: Number of clicks.  
                 - name: saves | type: integer | description: Number of saves.  
                 - name: comments | type: integer | description: Number of comments.  
                 - name: reactions | type: integer | description: Number of reactions.  
                 - name: updatedDate | type: string | description: Date and time the insights were last updated.  | validation: format date-time
           - name: gbpPost | type: GbpPost | description: Google Business Profile post content.  
              - name: locationId | type: string | description: The location GUID to publish the post to.  | validation: maxLength 128
              - name: locationAccountId | type: string | description: Account (group) GUID of the location.  | validation: maxLength 128
              - name: description | type: string | description: The description of the post.  | validation: maxLength 1500
              - name: callToAction | type: GbpPostCallToAction | description: Call to action type and URL to include in the post.  
                 - name: actionType | type: GbpPostCallToActionType | description: Type of the call to action.  
                         - enum: BOOK, ORDER, SHOP, LEARN_MORE, SIGN_UP
                 - name: url | type: string | description: URL of the call to action.  | validation: maxLength 2048
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
              - name: insights | type: GbpInsights | description: Insights from Google Business Profile.  | read-only: true 
                 - name: shares | type: integer | description: Number of shares. Google Business Profile post insights aren't currently available, so this returns `-1`.  
                 - name: updatedDate | type: string | description: Date and time the insights were last updated.  | validation: format date-time
           - name: tiktokVideo | type: TikTokVideo | description: TikTok video content.  
              - name: accountId | type: string | description: The account GUID to publish the video to.  | validation: maxLength 128
              - name: privacyLevel | type: TikTokPrivacyLevel | description: Privacy level for the video.  
                     - enum: PUBLIC_TO_EVERYONE, FOLLOWER_OF_CREATOR, MUTUAL_FOLLOW_FRIENDS, SELF_ONLY
              - name: description | type: string | description: A description for the video.  | validation: maxLength 2200
              - name: disableComment | type: boolean | description: Whether comments are disabled for the video.  
              - name: disableDuet | type: boolean | description: Whether duets are disabled for the video.  
              - name: disableStitch | type: boolean | description: Whether stitches are disabled for the video.  
              - name: brandContentToggle | type: boolean | description: Whether the content is a paid partnership promoting a third-party business.  
              - name: brandOrganicToggle | type: boolean | description: Whether the content promotes the creator's own business.  
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
              - name: insights | type: TikTokInsights | description: Insights from TikTok.  | read-only: true 
                 - name: views | type: integer | description: Number of views.  
                 - name: likes | type: integer | description: Number of likes.  
                 - name: comments | type: integer | description: Number of comments.  
                 - name: shares | type: integer | description: Number of shares.  
                 - name: updatedDate | type: string | description: Date and time the insights were last updated.  | validation: format date-time
           - name: tiktokPhoto | type: TikTokPhoto | description: TikTok photo content.  
              - name: accountId | type: string | description: The account GUID to publish the photo to.  | validation: maxLength 128
              - name: privacyLevel | type: TikTokPrivacyLevel | description: Privacy level for the photo.  
              - name: title | type: string | description: A title for the photo.  | validation: maxLength 90
              - name: description | type: string | description: A description for the photo.  | validation: maxLength 4000
              - name: disableComment | type: boolean | description: Whether comments are disabled for the photo.  
              - name: autoAddMusic | type: boolean | description: Whether to automatically add music to the photo.  
              - name: brandContentToggle | type: boolean | description: Whether the content is a paid partnership promoting a third-party business.  
              - name: brandOrganicToggle | type: boolean | description: Whether the content promotes the creator's own business.  
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
              - name: insights | type: TikTokInsights | description: Insights from TikTok.  | read-only: true 
        - name: id | type: string | description: Item GUID.  | read-only: true | validation: format GUID
        - name: channel | type: Channel | description: Social channel the item is published to, and the account within that channel.  
           - name: name | type: ChannelName | description: Social channel the item is published to.  
                 - enum: INSTAGRAM, FACEBOOK, YOUTUBE, LINKEDIN, TWITTER, PINTEREST, GBP, TIKTOK
           - name: accountId | type: string | description: GUID of the connected account the item is published to.  
           - name: accountName | type: string | description: Display name of the connected account the item is published to.  | read-only: true 
           - name: externalItemId | type: string | description: GUID of the post on the social channel. Returned after the item is published.  | read-only: true 
           - name: externalItemUrl | type: string | description: URL of the post on the social channel. Returned after the item is published.  | read-only: true | validation: format WEB_URL
           - name: publishingTarget | type: PublishingTarget | description: Specific destination within the account, such as a Facebook page or a Pinterest board.  
              - name: id | type: string | description: GUID of the publishing target.  | validation: maxLength 128
              - name: displayName | type: string | description: Display name of the publishing target.  | validation: maxLength 2000
              - name: pictureUrl | type: string | description: URL of the publishing target's picture.  | validation: format WEB_URL
        - name: type | type: ItemType | description: Item format. The `type` and the content set in `data` must match a combination supported by the item's `channel.name`:  - Instagram: `POST` with `instagramPost`, or `STORY` with `instagramStory`. - Facebook: `POST` with `facebookPost`, `REEL` with `facebookReel`, or `STORY` with `facebookStory`. - YouTube: `VIDEO` with `youtubeVideo`, or `SHORT` with `youtubeShort`. - LinkedIn: `POST` with `linkedinPost`. - X (Twitter): `POST` with `twitterPost`. Deprecated: No longer functional as of July 31, 2026. - Pinterest: `POST` with `pinterestPost`. - Google Business Profile: `POST` with `gbpPost`. - TikTok: `POST` with `tiktokPhoto`, or `VIDEO` with `tiktokVideo`.  
             - enum:
             -     POST: A standard post.
             -     REEL: A short-form vertical video reel.
             -     VIDEO: A video.
             -     SHORT: A short-form vertical video.
             -     STORY: A story that's available for a limited time.
        - name: status | type: Status | description: Current status of the item in its lifecycle.  | read-only: true 
             - enum:
             -     PUBLISHED: Published to the social channel.
             -     SCHEDULED: Scheduled to be published at a future date.
             -     CANCELED: Scheduling was canceled before the item was published.
             -     FAILED: Publishing failed.
             -     DELETED: Deleted.
             -     PROCESSING: Publishing is in progress.
             -     DRAFT: Saved as a draft, not yet published.
             -     IN_QUEUE: Queued for publishing as part of a bulk operation.
        - name: publishedDate | type: string | description: Date and time the item was published. Returned only after the item is published.  | read-only: true | validation: format date-time
        - name: schedulingInfo | type: SchedulingInfo | description: Scheduling info. Set to schedule the item for a future date instead of publishing it immediately.  
           - name: scheduledDate | type: string | description: Date and time the item is scheduled to be published.  | validation: format date-time
           - name: schedulingTimestamp | type: string | description: Date and time the item was scheduled.  | read-only: true | validation: format date-time
        - name: consumerInfo | type: ConsumerInfo | description: Identifies what created the item.  Specify `consumerInfo.name` when you create or publish an item, using one stable name for whatever is making the call, whether that's an app, an AI agent, or a service of your own. An item created without it is stored with an empty name, and the name can't be added later, because Update Item doesn't change it. See [Identifying what created an item](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/item-v1/introduction.md#identifying-what-created-an-item).  
           - name: name | type: string | description: Stable name identifying what created the item, for example `social-marketing` for the Social Media Marketing dashboard. Use the same name across every call the caller makes, so that its items can be told apart from items created elsewhere on the site. Set on creation only. Update Item ignores it.  
        - name: referenceId | type: string | description: Caller-defined reference that uniquely identifies the item. Can be used to prevent duplicate publishing: an attempt to publish a second item with the same `referenceId` fails. Can also be used as a UTM campaign GUID.  
        - name: siteAnalytics | type: SiteAnalytics | description: Aggregated analytics for the site, attributed to traffic from this post.  
           - name: traffic | type: integer | description: Number of site sessions attributed to this post.  
           - name: pageView | type: integer | description: Number of page views attributed to this post.  
           - name: siteBounceRate | type: float | description: Site bounce rate attributed to this post.  
           - name: revenue | type: float | description: Revenue attributed to this post.  
           - name: conversionFunnel | type: ConversionFunnel | description: Conversion funnel data attributed to this post.  
              - name: cartViewsSessions | type: integer | description: Number of sessions that viewed the cart.  
              - name: checkOutSessions | type: integer | description: Number of sessions that reached checkout.  
              - name: storeOrdersSessions | type: integer | description: Number of sessions that placed a store order.  
              - name: bookingsConfirmed | type: integer | description: Number of confirmed bookings.  
           - name: updatedDate | type: string | description: Date and time the insights were last updated.  | validation: format date-time
        - name: insightsSummary | type: InsightsSummary | description: Summary of the post's performance on the social channel, such as impressions and interactions.  
           - name: impressions | type: integer | description: Number of unique impressions (reach).  
           - name: interactions | type: integer | description: Number of interactions, such as likes and comments.  
           - name: updatedDate | type: string | description: Date and time the insights were last updated.  | validation: format date-time
           - name: impressionsTotal | type: integer | description: Total number of impressions.  
        - name: draftInfo | type: DraftInfo | description: Creation and update dates, returned for draft items.  
           - name: createdDate | type: string | description: Date and time the draft was created.  | read-only: true | validation: format date-time
           - name: updatedDate | type: string | description: Date and time the draft was updated.  | read-only: true | validation: format date-time
        - name: suggested | type: boolean | description: Whether the item was generated as an AI suggestion.  
        - name: external | type: boolean | description: Whether the item is a post created natively on the social channel rather than published through Wix.  
        - name: publicationError | type: PublicationErrorDetails | description: Details of why the item failed to publish. Returned only when `status` is `FAILED`.  | read-only: true 
           - name: message | type: string | description: Error message shown when publishing fails.  | read-only: true | validation: maxLength 500
        - name: siteAssetRef | type: AssetReference | description: Reference to the site content the post promotes, such as a product, a blog post, or an event. Set per channel.  
           - name: siteAssetRefType | type: Type | description: Type of the site asset (for example, product or blog post). See `SiteAsset.Type` for the closed set of values.  
                 - enum:
                 -     BLOG_POST: A Wix Blog post.
                 -     EVENT: A Wix Events event.
                 -     STORES_PRODUCT: A Wix Stores product.
                 -     BOOKINGS_SERVICE: A Wix Bookings service.
                 -     STORES_COUPON: A Wix Stores coupon.
                 -     STORES_CATEGORY: A Wix Stores category.
           - name: id | type: string | description: GUID of the asset within its provider's data store.  | validation: maxLength 256
           - name: name | type: string | description: Display name of the asset (for example, the product title or blog post title), cached at post-creation time.  | validation: maxLength 3000
        - name: originItemId | type: string | description: GUID of the item this item was derived from, when publishing produced several items from one. Currently set only by `PublishMultiStoryDraft`, which splits a multi-media story draft into one published item per frame: every resulting item carries the originating draft's GUID here. Lets a consumer re-correlate the new items with whatever it had recorded against the original draft, which no longer exists after the split. Set by the publisher, never by the caller.  | read-only: true | validation: format GUID
     - name: title | type: string | description: Title of the marketing activity.  | validation: maxLength 3000
     - name: description | type: string | description: Description of the marketing activity.  | validation: maxLength 3000
     - name: videoCandidates | type: array<VideoCandidate> | description: Asynchronously generated video options for this activity. Poll `GetMarketingActivityPosts` to check their status.  | validation: minItems 0, maxItems 10
        - name: executionId | type: string | description: Unique identifier of the video generation process.  | read-only: true | validation: format GUID
        - name: status | type: VideoCandidateStatus | description: Current generation status of the video candidate.  
             - enum:
             -     IN_PROGRESS: Video is currently being generated.
             -     FAILED: Generation failed. Add a new candidate to retry.
             -     READY: Video is ready. `video_url` is populated.
        - name: videoUrl | type: string | description: URL of the generated video. Returned only when `status` is `READY`.  | validation: format WEB_URL
        - name: prompt | type: string | description: Prompt used to generate the video.  | validation: maxLength 5000
        - name: sourceMediaUrl | type: string | description: URL of the source media used as input for video generation.  | validation: format WEB_URL
        - name: itemType | type: ItemType | description: Type of activity content this video was generated for. Either `POST` or `STORY`. Defaults to `POST`.  
     - name: asset | type: AssetReference | description: Site asset this activity is grounded in.  
        - name: type | type: Type | description: Type of the site asset (for example, product or blog post). See `SiteAsset.Type` for the closed set of values.  
        - name: id | type: string | description: GUID of the asset within its provider's data store.  | validation: maxLength 256
        - name: name | type: string | description: Display name of the asset (for example, the product title or blog post title), cached at activity-generation time.  | validation: maxLength 3000


```

### Examples

### Replace one frame of a marketing activity's stories
Replace the media on a marketing activity's story drafts with a specific media URL, for example an image the user picked from the Media Manager. Specify `mediaIndex` to replace a single frame, or omit it to replace the whole story with the one new media item. Returns the updated marketing activity.

```curl
curl -X PATCH \
'https://www.wixapis.com/promote/marketing-plan-service/v1/marketing-plan/update-marketing-activity-stories-media' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "marketingActivityId": "b3f9d2e1-7a4c-4d68-9f02-1c5e8a6b4d30",
  "mediaUrl": "https://static.wixstatic.com/media/cf2434_e0473b19f8ac4d62a5187cb3d09f2e64~mv2.jpg",
  "mediaType": "IMAGE",
  "fileId": "cf2434_e0473b19f8ac4d62a5187cb3d09f2e64~mv2.jpg",
  "mediaIndex": 1
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.promoteGrowthToolsMarketingPlan.marketingPlan.updateMarketingActivityStoriesMedia(marketingActivityId, options)
 Description: Updates the media on a marketing activity's story drafts with the provided media URL, leaving its post drafts unchanged.  A story draft holds one media item per frame, up to 5 frames. Specify `mediaIndex` to replace a single frame, or omit it to replace the whole story with the one new media item. A story that has no frame at that index is left unchanged.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  marketingActivityId, options.mediaUrl, options.mediaType, options
 Method parameters: 
   param name: marketingActivityId | type: string | description: GUID of the marketing activity whose story drafts will have their media replaced. | required: true | validation: format GUID
   param name: options | type: UpdateMarketingActivityStoriesMediaOptions  none | required: true 
        - name: mediaUrl | type: string | description: URL of the media to apply to the activity's stories. | required: true | validation: maxLength 2048, format WEB_URL
        - name: mediaType | type: MediaType | description: Type of the media at `mediaUrl`. | required: true 
             - enum: IMAGE, VIDEO
        - name: fileId | type: string | description: Media Manager file GUID backing the media, when the media originates from the Media Manager.  | validation: maxLength 1000
        - name: mediaIndex | type: integer | description: Optional 0-based index of the story frame to replace. When omitted, the story's entire media set is replaced with the single new media. Stories that have no frame at this index are left unchanged.  | validation: format int32
 Return type: PROMISE<UpdateMarketingActivityStoriesMediaResponse>
  - name: marketingActivity | type: SocialPlanMarketingActivity | description: The marketing activity with its updated media applied.  
     - name: marketingActivityId | type: string | description: Marketing activity GUID.  | read-only: true | validation: format GUID
     - name: date | type: Date | description: Scheduled date of the marketing activity.  
     - name: items | type: array<Item> | description: Posts associated with this activity. Items can be of any status (`DRAFT`, `SCHEDULED`, or published). Only items whose `status` is `DRAFT` can be scheduled with `ScheduleDrafts`.  | validation: minItems 0, maxItems 10
        - ONE-OF: 
           - name: instagramPost | type: InstagramPost | description: Instagram post content.  
              - ONE-OF: 
                 - name: imageUrl | type: string | description: The image URL.  
                 - name: videoUrl | type: string | description: The video URL.  
                 - name: mediaWrapper | type: MediaWrapper | description: The media list.  
                    - name: media | type: array<Media> | description: List of media items.  
                       - name: type | type: MediaType | description: Media type.  
                                 - enum: IMAGE, VIDEO
                       - name: url | type: string | description: Media URL.  | validation: format WEB_URL
                       - name: fileId | type: string | description: Media Manager file GUID backing the media. Available only when the media is stored in the Media Manager.  | validation: maxLength 1000
              - name: caption | type: string | description: Caption for the post. Can include hashtags (for example, `#crazywildebeest`) and mentions of Instagram users (for example, `@natgeo`). Mentioned users are notified when the post is published. Supports up to 30 hashtags and 20 mentions.  | validation: maxLength 2200
              - name: postUrl | type: string | description: The post URL on Instagram.  | read-only: true 
              - name: insights | type: InstagramInsights | description: Insights from Instagram.  | read-only: true 
                 - name: likes | type: integer | description: Number of likes.  
                 - name: engagement | type: integer | description: Number of engagements.  
                 - name: impressions | type: integer | description: Number of impressions.  
                 - name: plays | type: integer | description: Number of plays.  
                 - name: reach | type: integer | description: Number of accounts reached.  
                 - name: comments | type: integer | description: Number of comments.  
                 - name: shares | type: integer | description: Number of shares.  
                 - name: saved | type: integer | description: Number of saves.  
                 - name: totalInteractions | type: integer | description: Total number of interactions.  
           - name: instagramStory | type: InstagramStory | description: Instagram story content.  
              - name: storyUrl | type: string | description: The story URL on Instagram.  | read-only: true | validation: format WEB_URL
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
              - name: insights | type: InstagramStoryInsights | description: insights data from Instagram.  | read-only: true 
                 - name: impressions | type: integer | description: Number of impressions.  
                 - name: reach | type: integer | description: Number of accounts reached.  
                 - name: replies | type: integer | description: Number of replies.  
           - name: facebookPost | type: FacebookPost | description: Facebook post content.  
              - ONE-OF: 
                 - name: imageUrl | type: string | description: The image URL.  
                 - name: videoUrl | type: string | description: The video URL.  
                 - name: link | type: string | description: The link URL.  
                 - name: mediaWrapper | type: MediaWrapper | description: The media list.  
              - name: pageId | type: string | description: The page GUID to publish the post to.  
              - name: caption | type: string | description: Caption for the post.  
              - name: postUrl | type: string | description: The post URL on Facebook.  | read-only: true 
              - name: linkMetadata | type: LinkMetadata | description: Link preview metadata. Available only when the post contains a link.  
                 - name: thumbnailUrl | type: string | description: Thumbnail URL for the link preview.  
                 - name: title | type: string | description: Title for the link preview.  
                 - name: description | type: string | description: Description for the link preview.  
              - name: insights | type: FacebookInsights | description: Insights from Facebook.  | read-only: true 
                 - name: impressions | type: FacebookImpressions | description: Impression counts.  
                    - name: unique | type: integer | description: Number of unique impressions.  
                    - name: total | type: integer | description: Total number of impressions.  
                 - name: interactions | type: FacebookInteractions | description: Interaction counts.  
                    - name: unique | type: integer | description: Number of unique interactions.  
                    - name: total | type: integer | description: Total number of interactions.  
                 - name: reactions | type: FacebookReactions | description: Reaction counts.  
                    - name: like | type: integer | description: Number of "like" reactions.  
                    - name: love | type: integer | description: Number of "love" reactions.  
                    - name: wow | type: integer | description: Number of "wow" reactions.  
                    - name: haha | type: integer | description: Number of "haha" reactions.  
                    - name: sad | type: integer | description: Number of "sad" reactions.  
                    - name: anger | type: integer | description: Number of "angry" reactions.  
                 - name: activity | type: FacebokActivity | description: Activity counts.  
                    - name: share | type: integer | description: Number of shares.  
                    - name: like | type: integer | description: Number of likes.  
                    - name: comment | type: integer | description: Number of comments.  
                 - name: _updatedDate | type: Date | description: Date and time the insights were last updated.  
           - name: facebookReel | type: FacebookReel | description: Facebook reel content.  
              - name: pageId | type: string | description: The page GUID to publish the reel to.  
              - name: videoUrl | type: string | description: The video URL.  
              - name: description | type: string | description: A description for the reel.  
              - name: insights | type: FacebookInsights | description: Insights from Facebook.  | read-only: true 
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
           - name: facebookStory | type: FacebookStory | description: Facebook story content.  
              - name: pageId | type: string | description: The page GUID to publish the story to.  | validation: maxLength 1024
              - name: storyUrl | type: string | description: The story URL on Facebook.  | read-only: true | validation: format WEB_URL
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
              - name: insights | type: FacebookInsights | description: Insights from Facebook.  | read-only: true 
           - name: youtubeVideo | type: YouTubeVideo | description: YouTube video content.  
              - name: channelId | type: string | description: The channel GUID to publish the video to.  
              - name: videoUrl | type: string | description: The video URL.  
              - name: title | type: string | description: A title for the video.  
              - name: description | type: string | description: A description for the video.  
              - name: categoryId | type: string | description: A category for the video.  
              - name: notifySubscribers | type: boolean | description: Whether to notify channel subscribers when the video is published.  
              - name: insights | type: YoutubeInsights | description: Insights data from YouTube.  | read-only: true 
                 - name: views | type: integer | description: Number of views.  
                 - name: comments | type: integer | description: Number of comments.  
                 - name: likes | type: integer | description: Number of likes.  
                 - name: dislikes | type: integer | description: Number of dislikes.  
                 - name: shares | type: integer | description: Number of shares.  
                 - name: _updatedDate | type: Date | description: Date and time the insights were last updated.  
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
           - name: youtubeShort | type: YouTubeShort | description: YouTube short content.  
              - name: channelId | type: string | description: The channel GUID to publish the short to.  
              - name: videoUrl | type: string | description: The short URL.  
              - name: title | type: string | description: A title for the short.  
              - name: description | type: string | description: A description for the short.  
              - name: categoryId | type: string | description: A category for the short.  
              - name: notifySubscribers | type: boolean | description: Whether to notify channel subscribers when the short is published.  
              - name: insights | type: YoutubeInsights | description: Insights data from YouTube.  | read-only: true 
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
           - name: linkedinPost | type: LinkedinPost | description: LinkedIn post content.  
              - ONE-OF: 
                 - name: imageUrl | type: string | description: The image URL.  
                 - name: videoUrl | type: string | description: The video URL.  
                 - name: link | type: string | description: The link URL.  
                 - name: mediaWrapper | type: MediaWrapper | description: The media list.  
              - name: authorId | type: string | description: Author GUID of the post. Can be an organization page or a personal feed.  
              - name: caption | type: string | description: Caption for the post.  
              - name: linkMetadata | type: LinkMetadata | description: Link preview metadata. Available only when the post contains a link.  
              - name: insights | type: LinkedinPostInsights | description: Insights from LinkedIn.  | read-only: true 
                 - name: uniqueImpressions | type: integer | description: Number of unique impressions.  
                 - name: impression | type: integer | description: Total number of impressions.  
                 - name: shares | type: integer | description: Number of shares.  
                 - name: engagement | type: float | description: Engagement rate.  
                 - name: clicks | type: integer | description: Number of clicks.  
                 - name: likes | type: integer | description: Number of likes.  
                 - name: comments | type: integer | description: Number of comments.  
                 - name: _updatedDate | type: Date | description: Date and time the insights were last updated.  
           - name: pinterestPost | type: PinterestPost | description: Pinterest post content.  
              - name: boardId | type: string | description: The board GUID to publish the post to.  | validation: maxLength 128
              - name: title | type: string | description: The title of the post.  | validation: maxLength 100
              - name: description | type: string | description: The description of the post.  | validation: maxLength 800
              - name: link | type: string | description: The link to include in the post.  | validation: maxLength 2048
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
              - name: insights | type: PinterestInsights | description: Insights from Pinterest.  | read-only: true 
                 - name: impressions | type: integer | description: Number of impressions.  
                 - name: clicks | type: integer | description: Number of clicks.  
                 - name: saves | type: integer | description: Number of saves.  
                 - name: comments | type: integer | description: Number of comments.  
                 - name: reactions | type: integer | description: Number of reactions.  
                 - name: _updatedDate | type: Date | description: Date and time the insights were last updated.  
           - name: gbpPost | type: GbpPost | description: Google Business Profile post content.  
              - name: locationId | type: string | description: The location GUID to publish the post to.  | validation: maxLength 128
              - name: locationAccountId | type: string | description: Account (group) GUID of the location.  | validation: maxLength 128
              - name: description | type: string | description: The description of the post.  | validation: maxLength 1500
              - name: callToAction | type: GbpPostCallToAction | description: Call to action type and URL to include in the post.  
                 - name: actionType | type: GbpPostCallToActionType | description: Type of the call to action.  
                         - enum: BOOK, ORDER, SHOP, LEARN_MORE, SIGN_UP
                 - name: url | type: string | description: URL of the call to action.  | validation: maxLength 2048
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
              - name: insights | type: GbpInsights | description: Insights from Google Business Profile.  | read-only: true 
                 - name: shares | type: integer | description: Number of shares. Google Business Profile post insights aren't currently available, so this returns `-1`.  
                 - name: _updatedDate | type: Date | description: Date and time the insights were last updated.  
           - name: tiktokVideo | type: TikTokVideo | description: TikTok video content.  
              - name: accountId | type: string | description: The account GUID to publish the video to.  | validation: maxLength 128
              - name: privacyLevel | type: TikTokPrivacyLevel | description: Privacy level for the video.  
                     - enum: PUBLIC_TO_EVERYONE, FOLLOWER_OF_CREATOR, MUTUAL_FOLLOW_FRIENDS, SELF_ONLY
              - name: description | type: string | description: A description for the video.  | validation: maxLength 2200
              - name: disableComment | type: boolean | description: Whether comments are disabled for the video.  
              - name: disableDuet | type: boolean | description: Whether duets are disabled for the video.  
              - name: disableStitch | type: boolean | description: Whether stitches are disabled for the video.  
              - name: brandContentToggle | type: boolean | description: Whether the content is a paid partnership promoting a third-party business.  
              - name: brandOrganicToggle | type: boolean | description: Whether the content promotes the creator's own business.  
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
              - name: insights | type: TikTokInsights | description: Insights from TikTok.  | read-only: true 
                 - name: views | type: integer | description: Number of views.  
                 - name: likes | type: integer | description: Number of likes.  
                 - name: comments | type: integer | description: Number of comments.  
                 - name: shares | type: integer | description: Number of shares.  
                 - name: _updatedDate | type: Date | description: Date and time the insights were last updated.  
           - name: tiktokPhoto | type: TikTokPhoto | description: TikTok photo content.  
              - name: accountId | type: string | description: The account GUID to publish the photo to.  | validation: maxLength 128
              - name: privacyLevel | type: TikTokPrivacyLevel | description: Privacy level for the photo.  
              - name: title | type: string | description: A title for the photo.  | validation: maxLength 90
              - name: description | type: string | description: A description for the photo.  | validation: maxLength 4000
              - name: disableComment | type: boolean | description: Whether comments are disabled for the photo.  
              - name: autoAddMusic | type: boolean | description: Whether to automatically add music to the photo.  
              - name: brandContentToggle | type: boolean | description: Whether the content is a paid partnership promoting a third-party business.  
              - name: brandOrganicToggle | type: boolean | description: Whether the content promotes the creator's own business.  
              - name: mediaWrapper | type: MediaWrapper | description: The media list.  
              - name: insights | type: TikTokInsights | description: Insights from TikTok.  | read-only: true 
        - name: _id | type: string | description: Item GUID.  | read-only: true | validation: format GUID
        - name: channel | type: Channel | description: Social channel the item is published to, and the account within that channel.  
           - name: name | type: ChannelName | description: Social channel the item is published to.  
                 - enum: INSTAGRAM, FACEBOOK, YOUTUBE, LINKEDIN, TWITTER, PINTEREST, GBP, TIKTOK
           - name: accountId | type: string | description: GUID of the connected account the item is published to.  
           - name: accountName | type: string | description: Display name of the connected account the item is published to.  | read-only: true 
           - name: externalItemId | type: string | description: GUID of the post on the social channel. Returned after the item is published.  | read-only: true 
           - name: externalItemUrl | type: string | description: URL of the post on the social channel. Returned after the item is published.  | read-only: true | validation: format WEB_URL
           - name: publishingTarget | type: PublishingTarget | description: Specific destination within the account, such as a Facebook page or a Pinterest board.  
              - name: _id | type: string | description: GUID of the publishing target.  | validation: maxLength 128
              - name: displayName | type: string | description: Display name of the publishing target.  | validation: maxLength 2000
              - name: pictureUrl | type: string | description: URL of the publishing target's picture.  | validation: format WEB_URL
        - name: type | type: ItemType | description: Item format. The `type` and the content set in `data` must match a combination supported by the item's `channel.name`:  - Instagram: `POST` with `instagramPost`, or `STORY` with `instagramStory`. - Facebook: `POST` with `facebookPost`, `REEL` with `facebookReel`, or `STORY` with `facebookStory`. - YouTube: `VIDEO` with `youtubeVideo`, or `SHORT` with `youtubeShort`. - LinkedIn: `POST` with `linkedinPost`. - X (Twitter): `POST` with `twitterPost`. Deprecated: No longer functional as of July 31, 2026. - Pinterest: `POST` with `pinterestPost`. - Google Business Profile: `POST` with `gbpPost`. - TikTok: `POST` with `tiktokPhoto`, or `VIDEO` with `tiktokVideo`.  
             - enum:
             -     POST: A standard post.
             -     REEL: A short-form vertical video reel.
             -     VIDEO: A video.
             -     SHORT: A short-form vertical video.
             -     STORY: A story that's available for a limited time.
        - name: status | type: Status | description: Current status of the item in its lifecycle.  | read-only: true 
             - enum:
             -     PUBLISHED: Published to the social channel.
             -     SCHEDULED: Scheduled to be published at a future date.
             -     CANCELED: Scheduling was canceled before the item was published.
             -     FAILED: Publishing failed.
             -     DELETED: Deleted.
             -     PROCESSING: Publishing is in progress.
             -     DRAFT: Saved as a draft, not yet published.
             -     IN_QUEUE: Queued for publishing as part of a bulk operation.
        - name: publishedDate | type: Date | description: Date and time the item was published. Returned only after the item is published.  | read-only: true 
        - name: schedulingInfo | type: SchedulingInfo | description: Scheduling info. Set to schedule the item for a future date instead of publishing it immediately.  
           - name: scheduledDate | type: Date | description: Date and time the item is scheduled to be published.  
           - name: schedulingTimestamp | type: Date | description: Date and time the item was scheduled.  | read-only: true 
        - name: consumerInfo | type: ConsumerInfo | description: Identifies what created the item.  Specify `consumerInfo.name` when you create or publish an item, using one stable name for whatever is making the call, whether that's an app, an AI agent, or a service of your own. An item created without it is stored with an empty name, and the name can't be added later, because Update Item doesn't change it. See [Identifying what created an item](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/item-v1/introduction.md#identifying-what-created-an-item).  
           - name: name | type: string | description: Stable name identifying what created the item, for example `social-marketing` for the Social Media Marketing dashboard. Use the same name across every call the caller makes, so that its items can be told apart from items created elsewhere on the site. Set on creation only. Update Item ignores it.  
        - name: referenceId | type: string | description: Caller-defined reference that uniquely identifies the item. Can be used to prevent duplicate publishing: an attempt to publish a second item with the same `referenceId` fails. Can also be used as a UTM campaign GUID.  
        - name: siteAnalytics | type: SiteAnalytics | description: Aggregated analytics for the site, attributed to traffic from this post.  
           - name: traffic | type: integer | description: Number of site sessions attributed to this post.  
           - name: pageView | type: integer | description: Number of page views attributed to this post.  
           - name: siteBounceRate | type: float | description: Site bounce rate attributed to this post.  
           - name: revenue | type: float | description: Revenue attributed to this post.  
           - name: conversionFunnel | type: ConversionFunnel | description: Conversion funnel data attributed to this post.  
              - name: cartViewsSessions | type: integer | description: Number of sessions that viewed the cart.  
              - name: checkOutSessions | type: integer | description: Number of sessions that reached checkout.  
              - name: storeOrdersSessions | type: integer | description: Number of sessions that placed a store order.  
              - name: bookingsConfirmed | type: integer | description: Number of confirmed bookings.  
           - name: _updatedDate | type: Date | description: Date and time the insights were last updated.  
        - name: insightsSummary | type: InsightsSummary | description: Summary of the post's performance on the social channel, such as impressions and interactions.  
           - name: impressions | type: integer | description: Number of unique impressions (reach).  
           - name: interactions | type: integer | description: Number of interactions, such as likes and comments.  
           - name: _updatedDate | type: Date | description: Date and time the insights were last updated.  
           - name: impressionsTotal | type: integer | description: Total number of impressions.  
        - name: draftInfo | type: DraftInfo | description: Creation and update dates, returned for draft items.  
           - name: _createdDate | type: Date | description: Date and time the draft was created.  | read-only: true 
           - name: _updatedDate | type: Date | description: Date and time the draft was updated.  | read-only: true 
        - name: suggested | type: boolean | description: Whether the item was generated as an AI suggestion.  
        - name: external | type: boolean | description: Whether the item is a post created natively on the social channel rather than published through Wix.  
        - name: publicationError | type: PublicationErrorDetails | description: Details of why the item failed to publish. Returned only when `status` is `FAILED`.  | read-only: true 
           - name: message | type: string | description: Error message shown when publishing fails.  | read-only: true | validation: maxLength 500
        - name: siteAssetRef | type: AssetReference | description: Reference to the site content the post promotes, such as a product, a blog post, or an event. Set per channel.  
           - name: siteAssetRefType | type: Type | description: Type of the site asset (for example, product or blog post). See `SiteAsset.Type` for the closed set of values.  
                 - enum:
                 -     BLOG_POST: A Wix Blog post.
                 -     EVENT: A Wix Events event.
                 -     STORES_PRODUCT: A Wix Stores product.
                 -     BOOKINGS_SERVICE: A Wix Bookings service.
                 -     STORES_COUPON: A Wix Stores coupon.
                 -     STORES_CATEGORY: A Wix Stores category.
           - name: _id | type: string | description: GUID of the asset within its provider's data store.  | validation: maxLength 256
           - name: name | type: string | description: Display name of the asset (for example, the product title or blog post title), cached at post-creation time.  | validation: maxLength 3000
        - name: originItemId | type: string | description: GUID of the item this item was derived from, when publishing produced several items from one. Currently set only by `PublishMultiStoryDraft`, which splits a multi-media story draft into one published item per frame: every resulting item carries the originating draft's GUID here. Lets a consumer re-correlate the new items with whatever it had recorded against the original draft, which no longer exists after the split. Set by the publisher, never by the caller.  | read-only: true | validation: format GUID
     - name: title | type: string | description: Title of the marketing activity.  | validation: maxLength 3000
     - name: description | type: string | description: Description of the marketing activity.  | validation: maxLength 3000
     - name: videoCandidates | type: array<VideoCandidate> | description: Asynchronously generated video options for this activity. Poll `GetMarketingActivityPosts` to check their status.  | validation: minItems 0, maxItems 10
        - name: executionId | type: string | description: Unique identifier of the video generation process.  | read-only: true | validation: format GUID
        - name: status | type: VideoCandidateStatus | description: Current generation status of the video candidate.  
             - enum:
             -     IN_PROGRESS: Video is currently being generated.
             -     FAILED: Generation failed. Add a new candidate to retry.
             -     READY: Video is ready. `video_url` is populated.
        - name: videoUrl | type: string | description: URL of the generated video. Returned only when `status` is `READY`.  | validation: format WEB_URL
        - name: prompt | type: string | description: Prompt used to generate the video.  | validation: maxLength 5000
        - name: sourceMediaUrl | type: string | description: URL of the source media used as input for video generation.  | validation: format WEB_URL
        - name: itemType | type: ItemType | description: Type of activity content this video was generated for. Either `POST` or `STORY`. Defaults to `POST`.  
     - name: asset | type: AssetReference | description: Site asset this activity is grounded in.  
        - name: type | type: Type | description: Type of the site asset (for example, product or blog post). See `SiteAsset.Type` for the closed set of values.  
        - name: _id | type: string | description: GUID of the asset within its provider's data store.  | validation: maxLength 256
        - name: name | type: string | description: Display name of the asset (for example, the product title or blog post title), cached at activity-generation time.  | validation: maxLength 3000


```

### Examples

### Replace one frame of a marketing activity's stories
```javascript
// @description: Specify mediaIndex to replace a single frame, or omit it to replace the whole story with the one new media item.
import { marketingPlan } from "@wix/promote-growth-tools-marketing-plan";

const marketingActivityId = "b3f9d2e1-7a4c-4d68-9f02-1c5e8a6b4d30";

const options = {
  mediaUrl:
    "https://static.wixstatic.com/media/cf2434_e0473b19f8ac4d62a5187cb3d09f2e64~mv2.jpg",
  mediaType: marketingPlan.MediaType.IMAGE,
  fileId: "cf2434_e0473b19f8ac4d62a5187cb3d09f2e64~mv2.jpg",
  mediaIndex: 1,
};

async function updateMarketingActivityStoriesMedia() {
  const response = await marketingPlan.updateMarketingActivityStoriesMedia(
    marketingActivityId,
    options,
  );
}

/* Promise resolves to:
 * {
 *   "marketingActivity": {
 *     "marketingActivityId": "b3f9d2e1-7a4c-4d68-9f02-1c5e8a6b4d30",
 *     "date": "2026-07-08T09:00:00.000Z",
 *     "title": "Summer collection launch",
 *     "description": "Announce the new handmade ceramic mugs summer collection with a 20% launch discount.",
 *     "items": [
 *       {
 *         "_id": "8e2b7c94-0af1-4d35-b6e8-3c7f01d29b45",
 *         "channel": {
 *           "name": "INSTAGRAM",
 *           "accountId": "17841405822304914"
 *         },
 *         "type": "STORY",
 *         "status": "DRAFT",
 *         "instagramStory": {
 *           "mediaWrapper": {
 *             "media": [
 *               {
 *                 "type": "IMAGE",
 *                 "url": "https://static.wixstatic.com/media/cf2434_9d1f68b0c72e45a3b8e4f5027ac13d69~mv2.jpg"
 *               },
 *               {
 *                 "type": "IMAGE",
 *                 "url": "https://static.wixstatic.com/media/cf2434_e0473b19f8ac4d62a5187cb3d09f2e64~mv2.jpg",
 *                 "fileId": "cf2434_e0473b19f8ac4d62a5187cb3d09f2e64~mv2.jpg"
 *               },
 *               {
 *                 "type": "IMAGE",
 *                 "url": "https://static.wixstatic.com/media/cf2434_5b83c1e7a04f42d9b7e2680fc3915ad4~mv2.jpg"
 *               }
 *             ]
 *           }
 *         },
 *         "draftInfo": {
 *           "_createdDate": "2026-06-25T08:05:12.330Z",
 *           "_updatedDate": "2026-06-25T08:31:47.204Z"
 *         },
 *         "suggested": true,
 *         "external": false
 *       }
 *     ]
 *   }
 * }
 */

```

### updateMarketingActivityStoriesMedia (self-hosted)
Self-hosted SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { marketingPlan } from '@wix/promote-growth-tools-marketing-plan';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { marketingPlan },
  // Include the auth strategy and host as relevant
});


async function updateMarketingActivityStoriesMedia(marketingActivityId,options) {
  const response = await myWixClient.marketingPlan.updateMarketingActivityStoriesMedia(marketingActivityId,options);
};
```

---