> 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

# QueryMarketingActivities

# Package: marketingPlan

# Namespace: MarketingActivityService

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

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

## Introduction

Retrieves marketing activities matching the given filter.

Supported filter keys: `startDate`, `endDate`, `ids`, and `marketingActivityType`.
Filtering by `ids` can't be combined with `startDate`, `endDate`, or `marketingActivityType` filters.
Sorting, paging, and cursor paging in the request are ignored. Results are always sorted by `targetDate`
ascending and there's no server-side paging.

---

## REST API

### Schema

```
 Method: queryMarketingActivities
 Description: Retrieves marketing activities matching the given filter.  Supported filter keys: `startDate`, `endDate`, `ids`, and `marketingActivityType`. Filtering by `ids` can't be combined with `startDate`, `endDate`, or `marketingActivityType` filters. Sorting, paging, and cursor paging in the request are ignored. Results are always sorted by `targetDate` ascending and there's no server-side paging.
 URL: https://www.wixapis.com/promote/marketing-plan-service/v1/marketing-activities/query
 Method: POST
 Method parameters:
   param name: query | type: QueryV2    
    - ONE-OF: 
     - name: paging | type: Paging | description: Paging options to limit and skip the number of items.  
        - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, format int32
        - name: offset | type: integer | description: Number of items to skip in the current sort order.  | validation: minimum 0, format int32
     - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  
        - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
        - name: filter | type: object | description: Filter object.  Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-filter-section).  
        - name: sort | type: array<Sorting> | description: Sort object.  Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-sort-section).  | validation: maxItems 5
           - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
           - name: order | type: SortOrder | description: Sort order.  
                 - enum: ASC, DESC
        - name: fields | type: array<string> | description: Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned.  | validation: maxItems 5, maxLength 200
        - name: fieldsets | type: array<string> | description: Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned.  | validation: maxItems 5, maxLength 200
 Return type: QueryMarketingActivitiesResponse
  - name: marketingActivities | type: array<MarketingActivity> | description: List of activities matching the filter, sorted by `targetDate` ascending.  | validation: minItems 0, maxItems 20
     - ONE-OF: 
        - name: blogSeoData | type: BlogPostCandidate | description: SEO blog candidate data associated with this activity. Present only when `marketing_activity_type` is `BLOG`.  
           - name: id | type: string | description: blog post candidate id  | validation: format GUID
           - name: candidateData | type: CandidateData | description: ids of the blog post candidate  
              - name: blogPostCandidateId | type: string | description: id of the blog post topic  | validation: format GUID
              - name: contentPlanFlowId | type: string | description: id of the content plan flow this blog post candidate belongs to  | validation: format GUID
           - name: briefData | type: BriefData | description: data to use to generate blog post seo brief  
              - name: h1Title | type: string | description: title of the blog post  | validation: maxLength 1000
              - name: keyword | type: string | description: relevant keyword for the blog post  | validation: maxLength 1000
              - name: mainKeyword | type: string | description: main keyword for the blog post  | validation: maxLength 1000
              - name: serpData | type: SerpData | description: serp data for the main keyword  
                 - name: id | type: string | description: SerpDataResult GUID  | validation: format GUID
                 - name: peopleAlsoAskSuggestions | type: array<PeopleAlsoAskQuestion> | description: list of people also ask questions  | validation: maxItems 4
                    - name: question | type: string | description: people also ask question title  | validation: maxLength 10000
                    - name: answers | type: array<PeopleAlsoAskAnswer> | description: answers to the question  | validation: maxItems 2
                       - name: title | type: string | description: people also ask answer title  | validation: maxLength 10000
                       - name: description | type: string | description: description of the answer  | validation: maxLength 10000
                 - name: peopleAlsoSearchSuggestions | type: array<string> | description: list of related searches  | validation: maxItems 10, maxLength 10000
                 - name: autocompleteSuggestions | type: array<string> | description: list of autocomplete suggestions  | validation: maxItems 15, maxLength 10000
              - name: pageUrl | type: string | description: related landing page  | validation: maxLength 1000
           - name: seoData | type: SeoSchema | description: seo data  
              - name: tags | type: array<Tag> | description: SEO tag information.  
                 - name: type | type: string | description: SEO tag type.   Supported values: `title`, `meta`, `script`, `link`.  
                 - name: props | type: object | description: A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value. For example: `{"name": "description", "content": "the description itself"}`.  
                 - name: meta | type: object | description: SEO tag metadata. For example, `{"height": 300, "width": 240}`.  
                 - name: children | type: string | description: SEO tag inner content. For example, `<title> inner content </title>`.  
                 - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages).  
                 - name: disabled | type: boolean | description: Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines.  
              - name: settings | type: Settings | description: SEO general settings.  
                 - name: preventAutoRedirect | type: boolean | description: Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled.   Default: `false` (automatical redirect is enabled).  
                 - name: keywords | type: array<Keyword> | description: User-selected keyword terms for a specific page.  | validation: maxItems 5
                    - name: term | type: string | description: Keyword value.  
                    - name: isMain | type: boolean | description: Whether the keyword is the main focus keyword.  
                    - name: origin | type: string | description: The source that added the keyword terms to the SEO settings.  | validation: maxLength 1000
     - name: id | type: string | description: Unique activity GUID. Assigned on creation and read-only afterwards.  | validation: format GUID
     - name: marketingActivityType | type: ActivityType | description: Category of marketing action this activity represents.  
         - enum:
         -     SOCIAL_MARKETING: Activity targets social media channels (e.g. Facebook, Instagram).
         -     EMAIL_MARKETING: Activity targets an email campaign.
         -     BLOG: Activity targets a blog post.
     - name: title | type: string | description: Short label for the activity, suitable for display in a marketing plan UI.  | validation: maxLength 3000
     - name: description | type: string | description: Human-readable explanation of what the activity involves and why it was suggested.  | validation: maxLength 3000
     - name: targetDate | type: string | description: Scheduled date by which the activity should be completed or published.  | validation: format date-time
     - name: source | type: ActivitySource | description: Origin context that the AI used when generating this activity (for example, an upcoming event or a set of keywords).  
        - name: type | type: ActivitySourceType | description: Indicates what kind of input drove the AI to generate this activity.  
             - enum:
             -     EVENT: Activity was generated based on a site event.
             -     KEYWORDS: Activity was generated based on SEO or topic keywords.
             -     CONTENT_PILLARS: Activity was generated based on the site's content pillars.
        - name: value | type: string | description: The specific value of the source input (for example, an event name or a keyword string).  | validation: maxLength 3000
     - 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.  
             - 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 activity-generation time.  | validation: maxLength 3000


```

### Examples

### Query marketing activities
Query marketing activities by target date range and type. Only the filter keys startDate, endDate, ids, and marketingActivityType are honored; sorting and paging are ignored.

```curl
curl -X POST \
'https://www.wixapis.com/promote/marketing-plan-service/v1/marketing-activities/query' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "query": {
    "filter": {
      "startDate": "2026-07-01T00:00:00.000Z",
      "endDate": "2026-07-31T23:59:59.000Z",
      "marketingActivityType": "SOCIAL_MARKETING"
    }
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.promoteGrowthToolsMarketingPlan.marketingActivities.queryMarketingActivities(options)
 Description: Retrieves marketing activities matching the given filter.  Supported filter keys: `startDate`, `endDate`, `ids`, and `marketingActivityType`. Filtering by `ids` can't be combined with `startDate`, `endDate`, or `marketingActivityType` filters. Sorting, paging, and cursor paging in the request are ignored. Results are always sorted by `targetDate` ascending and there's no server-side paging.
 Method parameters:
   param name: options | type: QueryMarketingActivitiesOptions  none  
        - name: query | type: QueryV2 | description: Query options for filtering, sorting, and paging the results.  
           - ONE-OF: 
              - name: paging | type: Paging | description: Paging options to limit and skip the number of items.  
                 - name: limit | type: integer | description: Number of items to load.  | validation: minimum 0, format int32
                 - name: offset | type: integer | description: Number of items to skip in the current sort order.  | validation: minimum 0, format int32
              - name: cursorPaging | type: CursorPaging | description: Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.  
                 - name: limit | type: integer | description: Maximum number of items to return in the results.  | validation: minimum 0, maximum 100, format int32
                 - name: cursor | type: string | description: Pointer to the next or previous page in the list of results.  Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request.  | validation: maxLength 16000
           - name: filter | type: object | description: Filter object.  Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-filter-section).  
           - name: sort | type: array<Sorting> | description: Sort object.  Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#the-sort-section).  | validation: maxItems 5
              - name: fieldName | type: string | description: Name of the field to sort by.  | validation: maxLength 512
              - name: order | type: SortOrder | description: Sort order.  
                     - enum: ASC, DESC
           - name: fields | type: array<string> | description: Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned.  | validation: maxItems 5, maxLength 200
           - name: fieldsets | type: array<string> | description: Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned.  | validation: maxItems 5, maxLength 200
 Return type: PROMISE<QueryMarketingActivitiesResponse>
  - name: marketingActivities | type: array<MarketingActivity> | description: List of activities matching the filter, sorted by `targetDate` ascending.  | validation: minItems 0, maxItems 20
     - ONE-OF: 
        - name: blogSeoData | type: BlogPostCandidate | description: SEO blog candidate data associated with this activity. Present only when `marketing_activity_type` is `BLOG`.  
           - name: _id | type: string | description: blog post candidate id  | validation: format GUID
           - name: candidateData | type: CandidateData | description: ids of the blog post candidate  
              - name: blogPostCandidateId | type: string | description: id of the blog post topic  | validation: format GUID
              - name: contentPlanFlowId | type: string | description: id of the content plan flow this blog post candidate belongs to  | validation: format GUID
           - name: briefData | type: BriefData | description: data to use to generate blog post seo brief  
              - name: h1Title | type: string | description: title of the blog post  | validation: maxLength 1000
              - name: keyword | type: string | description: relevant keyword for the blog post  | validation: maxLength 1000
              - name: mainKeyword | type: string | description: main keyword for the blog post  | validation: maxLength 1000
              - name: serpData | type: SerpData | description: serp data for the main keyword  
                 - name: _id | type: string | description: SerpDataResult GUID  | validation: format GUID
                 - name: peopleAlsoAskSuggestions | type: array<PeopleAlsoAskQuestion> | description: list of people also ask questions  | validation: maxItems 4
                    - name: question | type: string | description: people also ask question title  | validation: maxLength 10000
                    - name: answers | type: array<PeopleAlsoAskAnswer> | description: answers to the question  | validation: maxItems 2
                       - name: title | type: string | description: people also ask answer title  | validation: maxLength 10000
                       - name: description | type: string | description: description of the answer  | validation: maxLength 10000
                 - name: peopleAlsoSearchSuggestions | type: array<string> | description: list of related searches  | validation: maxItems 10, maxLength 10000
                 - name: autocompleteSuggestions | type: array<string> | description: list of autocomplete suggestions  | validation: maxItems 15, maxLength 10000
              - name: pageUrl | type: string | description: related landing page  | validation: maxLength 1000
           - name: seoData | type: SeoSchema | description: seo data  
              - name: tags | type: array<Tag> | description: SEO tag information.  
                 - name: type | type: string | description: SEO tag type.   Supported values: `title`, `meta`, `script`, `link`.  
                 - name: props | type: object | description: A `{"key": "value"}` pair object where each SEO tag property (`"name"`, `"content"`, `"rel"`, `"href"`) contains a value. For example: `{"name": "description", "content": "the description itself"}`.  
                 - name: meta | type: object | description: SEO tag metadata. For example, `{"height": 300, "width": 240}`.  
                 - name: children | type: string | description: SEO tag inner content. For example, `<title> inner content </title>`.  
                 - name: custom | type: boolean | description: Whether the tag is a [custom tag](https://support.wix.com/en/article/adding-additional-meta-tags-to-your-sites-pages).  
                 - name: disabled | type: boolean | description: Whether the tag is disabled. If the tag is disabled, people can't find your page when searching for this phrase in search engines.  
              - name: settings | type: Settings | description: SEO general settings.  
                 - name: preventAutoRedirect | type: boolean | description: Whether the [automatical redirect visits](https://support.wix.com/en/article/customizing-your-pages-seo-settings-in-the-seo-panel) from the old URL to the new one is enabled.   Default: `false` (automatical redirect is enabled).  
                 - name: keywords | type: array<Keyword> | description: User-selected keyword terms for a specific page.  | validation: maxItems 5
                    - name: term | type: string | description: Keyword value.  
                    - name: isMain | type: boolean | description: Whether the keyword is the main focus keyword.  
                    - name: origin | type: string | description: The source that added the keyword terms to the SEO settings.  | validation: maxLength 1000
     - name: _id | type: string | description: Unique activity GUID. Assigned on creation and read-only afterwards.  | validation: format GUID
     - name: marketingActivityType | type: ActivityType | description: Category of marketing action this activity represents.  
         - enum:
         -     SOCIAL_MARKETING: Activity targets social media channels (e.g. Facebook, Instagram).
         -     EMAIL_MARKETING: Activity targets an email campaign.
         -     BLOG: Activity targets a blog post.
     - name: title | type: string | description: Short label for the activity, suitable for display in a marketing plan UI.  | validation: maxLength 3000
     - name: description | type: string | description: Human-readable explanation of what the activity involves and why it was suggested.  | validation: maxLength 3000
     - name: targetDate | type: Date | description: Scheduled date by which the activity should be completed or published.  
     - name: source | type: ActivitySource | description: Origin context that the AI used when generating this activity (for example, an upcoming event or a set of keywords).  
        - name: type | type: ActivitySourceType | description: Indicates what kind of input drove the AI to generate this activity.  
             - enum:
             -     EVENT: Activity was generated based on a site event.
             -     KEYWORDS: Activity was generated based on SEO or topic keywords.
             -     CONTENT_PILLARS: Activity was generated based on the site's content pillars.
        - name: value | type: string | description: The specific value of the source input (for example, an event name or a keyword string).  | validation: maxLength 3000
     - 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.  
             - 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 activity-generation time.  | validation: maxLength 3000


```

### Examples

### Query marketing activities
Only the filter keys startDate, endDate, ids, and marketingActivityType are honored; sorting and paging are ignored.

```javascript
import { marketingActivities } from "@wix/promote-growth-tools-marketing-plan";

const options = {
  query: {
    filter: {
      startDate: "2026-07-01T00:00:00.000Z",
      endDate: "2026-07-31T23:59:59.000Z",
      marketingActivityType: "SOCIAL_MARKETING",
    },
  },
};

async function queryMarketingActivities() {
  const response =
    await marketingActivities.queryMarketingActivities(options);
}

/* Promise resolves to:
 * {
 *   "marketingActivities": [
 *     {
 *       "_id": "f4c8a1d2-9b3e-4a7c-8f6d-2e1b5c9a0d3f",
 *       "title": "Summer Sale Instagram Campaign",
 *       "description": "Promote the summer collection with a series of Instagram posts highlighting new arrivals and seasonal discounts.",
 *       "targetDate": "2026-07-15T09:00:00.000Z",
 *       "marketingActivityType": "SOCIAL_MARKETING"
 *     }
 *   ]
 * }
 */

```

### queryMarketingActivities (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 { marketingActivities } 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: { marketingActivities },
  // Include the auth strategy and host as relevant
});


async function queryMarketingActivities(options) {
  const response = await myWixClient.marketingActivities.queryMarketingActivities(options);
};
```

---