> 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

# CreateContentPlan

# Package: seo

# Namespace: SeoBlogPostCandidateServiceV1

# Method link: https://dev.wix.com/docs/api-reference/business-management/seo/content-plan-blog-post-candidate-v1/create-content-plan.md

## Permission Scopes:
Manage SEO Settings: SCOPE.PROMOTE.MANAGE-SEO

## Introduction

Generates the blog post briefs for a content plan flow.

A content plan flow stops at `KEYWORD_RESEARCH` and waits. Call this
method to generate the briefs and let the flow continue to `SUCCESS`,
then poll Get Content Plan Flow to follow it. A flow that's only polled
never completes.

Called on a flow that already reached `SUCCESS`, this method regenerates
the plan under a separate content plan flow. The response carries the new
`contentPlanFlowId`, and you poll that ID rather than the original. The
original flow keeps its own candidates.

Check `success` in the response as well as the HTTP status. A request
that omits `contentPlanFlowId` reports every failure that way, with
`success` set to `false` and the reason in `message` rather than an
error. A generation failure reports that way even when you do send the
ID.

Call this method once for a flow and wait for it to return. Concurrent
calls for the same site can produce duplicate content plans.

---

## REST API

### Schema

```
 Method: createContentPlan
 Description: Generates the blog post briefs for a content plan flow.  A content plan flow stops at `KEYWORD_RESEARCH` and waits. Call this method to generate the briefs and let the flow continue to `SUCCESS`, then poll Get Content Plan Flow to follow it. A flow that's only polled never completes.  Called on a flow that already reached `SUCCESS`, this method regenerates the plan under a separate content plan flow. The response carries the new `contentPlanFlowId`, and you poll that GUID rather than the original. The original flow keeps its own candidates.  Check `success` in the response as well as the HTTP status. A request that omits `contentPlanFlowId` reports every failure that way, with `success` set to `false` and the reason in `message` rather than an error. A generation failure reports that way even when you do send the GUID.  Call this method once for a flow and wait for it to return. Concurrent calls for the same site can produce duplicate content plans.
 URL: https://www.wixapis.com/promote/seo/v1/create-content-plan
 Method: POST
 Method parameters:
   param name: contentPlanFlowId | type: contentPlanFlowId | description: GUID of the content plan flow to generate the blog post briefs for.  Omit to use the site's most recent eligible flow. Do not remove the fallback — existing callers depend on it.  | validation: format GUID
 Return type: CreateContentPlanResponse
  - name: success | type: boolean | description: Whether the blog post briefs were generated.  Check this field as well as the HTTP status. Some failures return `false` here rather than an error.  
  - name: message | type: string | description: Reason the generation failed.  Returned only when `success` is `false`.  | validation: maxLength 1000
  - name: contentPlanFlowId | type: string | description: GUID of the content plan flow the briefs were generated under.  When this method regenerates a plan for a flow that already succeeded, this is a new GUID. Poll this GUID rather than the one you sent.  | validation: format GUID

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: CONTENT_PLAN_FLOW_NOT_FOUND | Description: Couldn't find the content plan flow.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: CONTENT_PLAN_FLOW_CANCELED | Description: The flow was canceled while generation was running, so no content plan was produced.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: FLOW_NOT_READY_FOR_CONTENT_PLAN | Description: The flow's status is neither `SUCCESS` nor `KEYWORD_RESEARCH`, so a content plan can't be generated from it.


```

### Examples

### Generate the blog post briefs for a content plan flow
Releases a flow parked at KEYWORD_RESEARCH. Check the success field as well as the HTTP status, and poll the returned contentPlanFlowId.

```curl
curl -X POST \
'https://www.wixapis.com/seo-content-plan-service/v1/create-content-plan' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "contentPlanFlowId": "d290f1ee-6c54-4b01-90e6-d701748f0851"
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.seo.blogPostCandidates.createContentPlan(options)
 Description: Generates the blog post briefs for a content plan flow.  A content plan flow stops at `KEYWORD_RESEARCH` and waits. Call this method to generate the briefs and let the flow continue to `SUCCESS`, then poll Get Content Plan Flow to follow it. A flow that's only polled never completes.  Called on a flow that already reached `SUCCESS`, this method regenerates the plan under a separate content plan flow. The response carries the new `contentPlanFlowId`, and you poll that GUID rather than the original. The original flow keeps its own candidates.  Check `success` in the response as well as the HTTP status. A request that omits `contentPlanFlowId` reports every failure that way, with `success` set to `false` and the reason in `message` rather than an error. A generation failure reports that way even when you do send the GUID.  Call this method once for a flow and wait for it to return. Concurrent calls for the same site can produce duplicate content plans.
 Method parameters:
   param name: options | type: CreateContentPlanOptions  none  
        - name: contentPlanFlowId | type: string | description: GUID of the content plan flow to generate the blog post briefs for.  Omit to use the site's most recent eligible flow. Do not remove the fallback — existing callers depend on it.  | validation: format GUID
 Return type: PROMISE<CreateContentPlanResponse>
  - name: success | type: boolean | description: Whether the blog post briefs were generated.  Check this field as well as the HTTP status. Some failures return `false` here rather than an error.  
  - name: message | type: string | description: Reason the generation failed.  Returned only when `success` is `false`.  | validation: maxLength 1000
  - name: contentPlanFlowId | type: string | description: GUID of the content plan flow the briefs were generated under.  When this method regenerates a plan for a flow that already succeeded, this is a new GUID. Poll this GUID rather than the one you sent.  | validation: format GUID

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: CONTENT_PLAN_FLOW_NOT_FOUND | Description: Couldn't find the content plan flow.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: CONTENT_PLAN_FLOW_CANCELED | Description: The flow was canceled while generation was running, so no content plan was produced.
   HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: FLOW_NOT_READY_FOR_CONTENT_PLAN | Description: The flow's status is neither `SUCCESS` nor `KEYWORD_RESEARCH`, so a content plan can't be generated from it.


```

### Examples

### createContentPlan
```javascript
import { blogPostCandidates } from '@wix/seo';

async function createContentPlan(options) {
  const response = await blogPostCandidates.createContentPlan(options);
};
```

### createContentPlan (with elevated permissions)
```javascript
import { blogPostCandidates } from '@wix/seo';
import { auth } from '@wix/essentials';

async function myCreateContentPlanMethod(options) {
  const elevatedCreateContentPlan = auth.elevate(blogPostCandidates.createContentPlan);
  const response = await elevatedCreateContentPlan(options);
}
```

### createContentPlan (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 { blogPostCandidates } from '@wix/seo';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function createContentPlan(options) {
  const response = await myWixClient.blogPostCandidates.createContentPlan(options);
};
```

---