marketingActivityUpdate mutation
Updates a marketing activity.
Required access
write_marketing_events access scope.
On this page
Interactive example
This is an example mutation query. Use the embedded interactive tool below to edit the query.
Hint: use Ctrl + Space for autocompleting fields.
mutation marketingActivityUpdate($input: MarketingActivityUpdateInput!) { marketingActivityUpdate(input: $input) {} } { “input”: {
<font style="color:#1F61A0;">marketingActivity</font> <font style="color:#555555;">{</font><font style="color:#1F61A0;">id</font><font style="color:#555555;">}</font><font style="color:#1F61A0;">redirectPath</font><font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font><font style="color:#1F61A0;">field</font><font style="color:#1F61A0;">message</font><font style="color:#555555;">}</font>
} }
<font style="color:#8B2BB9;">"id"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE="</font>
Arguments
MarketingActivityUpdateInput fields
- adSpend (
[MoneyInput](https://shopify.dev/docs/admin-api/graphql/reference/common-objects/moneyinput))
The cumulative amount spent on this marketing activity. This argument is deprecated: UseMarketingEngagementCreate.MarketingEngagementInput.adSpendGraphQL to send the ad spend. - budget (
[MarketingActivityBudgetInput](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/marketingactivitybudgetinput))
The budget for this marketing activity. - context (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
Encoded context provided by Shopify during the update marketing activity callback. This argument is deprecated: This context is no longer needed by Shopify in the callback. - errors (
[JSON](https://shopify.dev/docs/admin-api/graphql/reference/scalar#json-2021-01))
Error messages generated when app was trying to complete this activity. - formData (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
The form data of the marketing activity. - id (
[ID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)) REQUIRED
The id for this marketing activity. - marketedResources (
[[ID!]](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01))A list of the items that were marketed in this marketing activity. Valid types for these items are:ProductShop(Must be your current shop).
 - marketingRecommendationId (
[ID](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01))
The ID of the recommendation this marketing activity was created from, if one exists. - status (
[MarketingActivityStatus](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/marketingactivitystatus))
The current state of the marketing activity. - targetStatus (
[MarketingActivityStatus](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/marketingactivitystatus))
The target state of the marketing activity. - title (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
The title of this marketing activity. - utm (
[UTMInput](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/utminput))
Specifies the Urchin Traffic Module (UTM) parameters that are associated with a related marketing campaign. UTMInput is required for all Marketing tactics except Storefront App. This utm param can be only set once and never modified. 
Return fields
- marketingActivity (
[MarketingActivity](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/marketingactivity))
The updated marketing activity. - redirectPath (
[String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
The path to return back to shopify admin from embedded editor. - userErrors (
[[UserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/usererror))
List of errors that occurred executing the mutation. 
