> 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

# RegenerateMarketingPlan

# Package: marketingPlan

# Namespace: AiPlanGeneratorService

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

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

## Introduction

Regenerates the upcoming activities of the existing marketing plan. Activities whose date is
already in the past are preserved.

Generation is asynchronous. The response immediately returns a `status` of `GENERATING`.
Poll `GetSocialMarketingPlan` until `status` is `ACTIVE` (ready) or `FAILED`.
A plan must already exist. If the plan is already generating, this method returns a
`FAILED_PRECONDITION` error ("plan already generating"). Poll `GetSocialMarketingPlan` until
the status is no longer `GENERATING` before calling this method. To include fresh SEO keyword
research and blog activities, use `RegenerateMarketingPlanWithKeywordResearch` instead.

---

## REST API

### Schema

```
 Method: regenerateMarketingPlan
 Description: Regenerates the upcoming activities of the existing marketing plan. Activities whose date is already in the past are preserved.  Generation is asynchronous. The response immediately returns a `status` of `GENERATING`. Poll `GetSocialMarketingPlan` until `status` is `ACTIVE` (ready) or `FAILED`. A plan must already exist. If the plan is already generating, this method returns a `FAILED_PRECONDITION` error ("plan already generating"). Poll `GetSocialMarketingPlan` until the status is no longer `GENERATING` before calling this method. To include fresh SEO keyword research and blog activities, use `RegenerateMarketingPlanWithKeywordResearch` instead.
 URL: https://www.wixapis.com/promote/marketing-plan-service/v1/marketing-plan/regenerate-marketing-plan
 Method: POST
 Return type: RegenerateMarketingPlanResponse
  - name: status | type: PlanStatus | description: Current plan status. Returns `GENERATING` immediately; poll `GetSocialMarketingPlan` until `ACTIVE` or `FAILED`.  
     - enum:
     -     NEVER_CREATED: No plan has been generated for this site yet.
     -     GENERATING: The plan is currently being generated. Poll `GetSocialMarketingPlan` until status changes.
     -     ACTIVE: The plan is ready to use and activities are available.
     -     INACTIVE: The plan was automatically deactivated after a long period without engagement. An `INACTIVE` plan returns no activities. Calling `GetSocialMarketingPlan` after a long idle period can itself trigger this transition. Generating or regenerating reactivates the plan.
     -     FAILED: Generation failed. Call a generate or regenerate method to try again.


```

### Examples

### Regenerate a marketing plan
Regenerate the existing social marketing plan for the site. Regeneration runs asynchronously, so the response returns the current plan status.

```curl
curl -X POST \
'https://www.wixapis.com/promote/marketing-plan-service/v1/marketing-plan/regenerate-marketing-plan' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.promoteGrowthToolsMarketingPlan.marketingPlan.regenerateMarketingPlan()
 Description: Regenerates the upcoming activities of the existing marketing plan. Activities whose date is already in the past are preserved.  Generation is asynchronous. The response immediately returns a `status` of `GENERATING`. Poll `GetSocialMarketingPlan` until `status` is `ACTIVE` (ready) or `FAILED`. A plan must already exist. If the plan is already generating, this method returns a `FAILED_PRECONDITION` error ("plan already generating"). Poll `GetSocialMarketingPlan` until the status is no longer `GENERATING` before calling this method. To include fresh SEO keyword research and blog activities, use `RegenerateMarketingPlanWithKeywordResearch` instead.
 Return type: PROMISE<RegenerateMarketingPlanResponse>
  - name: status | type: PlanStatus | description: Current plan status. Returns `GENERATING` immediately; poll `GetSocialMarketingPlan` until `ACTIVE` or `FAILED`.  
     - enum:
     -     NEVER_CREATED: No plan has been generated for this site yet.
     -     GENERATING: The plan is currently being generated. Poll `GetSocialMarketingPlan` until status changes.
     -     ACTIVE: The plan is ready to use and activities are available.
     -     INACTIVE: The plan was automatically deactivated after a long period without engagement. An `INACTIVE` plan returns no activities. Calling `GetSocialMarketingPlan` after a long idle period can itself trigger this transition. Generating or regenerating reactivates the plan.
     -     FAILED: Generation failed. Call a generate or regenerate method to try again.


```

### Examples

### Regenerate a marketing plan
```javascript
import { marketingPlan } from "@wix/promote-growth-tools-marketing-plan";

async function regenerateMarketingPlan() {
  const response = await marketingPlan.regenerateMarketingPlan();
}

/* Promise resolves to:
 * {
 *   "status": "GENERATING"
 * }
 */

```

### regenerateMarketingPlan (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 regenerateMarketingPlan() {
  const response = await myWixClient.marketingPlan.regenerateMarketingPlan();
};
```

---