--- title: marketingEvent - GraphQL Admin description: Returns a `MarketingEvent` resource by ID. api_version: 2025-10 api_name: admin type: query api_type: graphql source_url: html: https://shopify.dev/docs/api/admin-graphql/latest/queries/marketingevent md: https://shopify.dev/docs/api/admin-graphql/latest/queries/marketingevent.md --- # marketing​Event query Returns a `MarketingEvent` resource by ID. ## Arguments * id [ID!](https://shopify.dev/docs/api/admin-graphql/latest/scalars/ID) required The ID of the `MarketingEvent` to return. *** ## Possible returns * Marketing​Event [Marketing​Event](https://shopify.dev/docs/api/admin-graphql/latest/objects/MarketingEvent) Represents actions that market a merchant's store or products. *** ## Examples * ### Retrieves a single marketing event #### Query ```graphql query MarketingEventShow { marketingEvent(id: "gid://shopify/MarketingEvent/425025702") { id type remoteId startedAt endedAt scheduledToEndAt manageUrl previewUrl utmCampaign utmMedium utmSource description marketingChannelType sourceAndMedium } } ``` #### cURL ```bash curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query MarketingEventShow { marketingEvent(id: \"gid://shopify/MarketingEvent/425025702\") { id type remoteId startedAt endedAt scheduledToEndAt manageUrl previewUrl utmCampaign utmMedium utmSource description marketingChannelType sourceAndMedium } }" }' ``` #### React Router ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query MarketingEventShow { marketingEvent(id: "gid://shopify/MarketingEvent/425025702") { id type remoteId startedAt endedAt scheduledToEndAt manageUrl previewUrl utmCampaign utmMedium utmSource description marketingChannelType sourceAndMedium } }`, ); const json = await response.json(); return json.data; } ``` #### Ruby ```ruby session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY query MarketingEventShow { marketingEvent(id: "gid://shopify/MarketingEvent/425025702") { id type remoteId startedAt endedAt scheduledToEndAt manageUrl previewUrl utmCampaign utmMedium utmSource description marketingChannelType sourceAndMedium } } QUERY response = client.query(query: query) ``` #### Node.js ```javascript const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query MarketingEventShow { marketingEvent(id: "gid://shopify/MarketingEvent/425025702") { id type remoteId startedAt endedAt scheduledToEndAt manageUrl previewUrl utmCampaign utmMedium utmSource description marketingChannelType sourceAndMedium } }`, }); ``` #### Response ```json { "marketingEvent": { "id": "gid://shopify/MarketingEvent/425025702", "type": "NEWSLETTER", "remoteId": null, "startedAt": "2024-11-08T20:47:51Z", "endedAt": null, "scheduledToEndAt": null, "manageUrl": null, "previewUrl": null, "utmCampaign": "asdf", "utmMedium": "newsletter", "utmSource": "email", "description": null, "marketingChannelType": "EMAIL", "sourceAndMedium": "Email newsletter" } } ``` ## Retrieves a single marketing event [Open in GraphiQL](http://localhost:3457/graphiql?query=query%20MarketingEventShow%20%7B%0A%20%20marketingEvent\(id%3A%20%22gid%3A%2F%2Fshopify%2FMarketingEvent%2F425025702%22\)%20%7B%0A%20%20%20%20id%0A%20%20%20%20type%0A%20%20%20%20remoteId%0A%20%20%20%20startedAt%0A%20%20%20%20endedAt%0A%20%20%20%20scheduledToEndAt%0A%20%20%20%20manageUrl%0A%20%20%20%20previewUrl%0A%20%20%20%20utmCampaign%0A%20%20%20%20utmMedium%0A%20%20%20%20utmSource%0A%20%20%20%20description%0A%20%20%20%20marketingChannelType%0A%20%20%20%20sourceAndMedium%0A%20%20%7D%0A%7D) ```javascript import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query MarketingEventShow { marketingEvent(id: "gid://shopify/MarketingEvent/425025702") { id type remoteId startedAt endedAt scheduledToEndAt manageUrl previewUrl utmCampaign utmMedium utmSource description marketingChannelType sourceAndMedium } }`, ); const json = await response.json(); return json.data; } ``` ##### GQL ``` query MarketingEventShow { marketingEvent(id: "gid://shopify/MarketingEvent/425025702") { id type remoteId startedAt endedAt scheduledToEndAt manageUrl previewUrl utmCampaign utmMedium utmSource description marketingChannelType sourceAndMedium } } ``` ##### cURL ``` curl -X POST \ https://your-development-store.myshopify.com/admin/api/2025-10/graphql.json \ -H 'Content-Type: application/json' \ -H 'X-Shopify-Access-Token: {access_token}' \ -d '{ "query": "query MarketingEventShow { marketingEvent(id: \"gid://shopify/MarketingEvent/425025702\") { id type remoteId startedAt endedAt scheduledToEndAt manageUrl previewUrl utmCampaign utmMedium utmSource description marketingChannelType sourceAndMedium } }" }' ``` ##### React Router ``` import { authenticate } from "../shopify.server"; export const loader = async ({request}) => { const { admin } = await authenticate.admin(request); const response = await admin.graphql( `#graphql query MarketingEventShow { marketingEvent(id: "gid://shopify/MarketingEvent/425025702") { id type remoteId startedAt endedAt scheduledToEndAt manageUrl previewUrl utmCampaign utmMedium utmSource description marketingChannelType sourceAndMedium } }`, ); const json = await response.json(); return json.data; } ``` ##### Node.js ``` const client = new shopify.clients.Graphql({session}); const data = await client.query({ data: `query MarketingEventShow { marketingEvent(id: "gid://shopify/MarketingEvent/425025702") { id type remoteId startedAt endedAt scheduledToEndAt manageUrl previewUrl utmCampaign utmMedium utmSource description marketingChannelType sourceAndMedium } }`, }); ``` ##### Ruby ``` session = ShopifyAPI::Auth::Session.new( shop: "your-development-store.myshopify.com", access_token: access_token ) client = ShopifyAPI::Clients::Graphql::Admin.new( session: session ) query = <<~QUERY query MarketingEventShow { marketingEvent(id: "gid://shopify/MarketingEvent/425025702") { id type remoteId startedAt endedAt scheduledToEndAt manageUrl previewUrl utmCampaign utmMedium utmSource description marketingChannelType sourceAndMedium } } QUERY response = client.query(query: query) ``` ## Response JSON ```json { "marketingEvent": { "id": "gid://shopify/MarketingEvent/425025702", "type": "NEWSLETTER", "remoteId": null, "startedAt": "2024-11-08T20:47:51Z", "endedAt": null, "scheduledToEndAt": null, "manageUrl": null, "previewUrl": null, "utmCampaign": "asdf", "utmMedium": "newsletter", "utmSource": "email", "description": null, "marketingChannelType": "EMAIL", "sourceAndMedium": "Email newsletter" } } ```