> 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

# GetContentPlanFlow

# Package: seo

# Namespace: ContentPlanFlowServiceV1

# Method link: https://dev.wix.com/docs/api-reference/business-management/seo/content-plan-content-plan-flow-v1/get-content-plan-flow.md

## Permission Scopes:
View SEO Settings: SCOPE.PROMOTE.VIEW-SEO

## Introduction

Retrieves a content plan flow.

While a flow is generating, poll this method with the
`contentPlanFlowId` returned by Trigger Content Plan Generation Flow to
follow the flow's progress.

Omit `contentPlanFlowId` to retrieve the site's most recent successful
flow. This is useful for picking up a content plan that was generated in
the site dashboard. A flow that's still running is never returned this
way, and a site with no successful flow returns a not found error.

---

## REST API

### Schema

```
 Method: getContentPlanFlow
 Description: Retrieves a content plan flow.  While a flow is generating, poll this method with the `contentPlanFlowId` returned by Trigger Content Plan Generation Flow to follow the flow's progress.  Omit `contentPlanFlowId` to retrieve the site's most recent successful flow. This is useful for picking up a content plan that was generated in the site dashboard. A flow that's still running is never returned this way, and a site with no successful flow returns a not found error.
 URL: https://www.wixapis.com/promote/seo/v1/content-plan-flows/{contentPlanFlowId}
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  contentPlanFlowId
 Method parameters: 
   param name: contentPlanFlowId | type:   none | required: true 
 Return type: GetContentPlanFlowResponse
  - name: contentPlanFlow | type: ContentPlanFlow | description: Retrieved content plan flow.  
     - name: id | type: string | description: Content plan flow GUID.  | read-only: true | validation: format GUID
     - name: createdAt | type: string | description: Date and time the content plan flow was created.  | validation: maxLength 100
     - name: updatedAt | type: string | description: Date and time the content plan flow was updated.  | validation: maxLength 100
     - name: status | type: Status | description: Current status of the content plan flow.  The status advances on its own as generation progresses, except at `KEYWORD_RESEARCH`, where the flow waits for a call to Create Content Plan.  
         - enum:
         -     CREATED: The flow is created and the generation pipeline is starting.
         -     SITE_SUMMARY: The site's existing content is being summarized.
         -     KEYWORD_RESEARCH: Keyword research is complete and the flow is waiting. Call Create Content Plan to generate the blog post briefs and continue the flow.
         -     CONTENT_PLAN: Blog post briefs are being generated from the keyword research.
         -     SUCCESS: Generation is complete. Retrieve the results with List Blog Post Candidates and List Keyword Research Items.
         -     FAIL: Generation failed. Trigger a flow to try again.
         -     PENDING_REQUIREMENTS: The site is missing business information that keyword research requires. The flow resumes automatically once the information is added to the site.
         -     CANCELED: The flow was canceled and can't be resumed.
         -     SITE_ANALYSIS: The site's pages are being analyzed.
     - name: origin | type: string | description: What started the content plan flow. Flows started by an app are recorded as `AGENT`.  | validation: maxLength 100
     - name: summaryId | type: string | description: GUID of the site content summary the flow produced.  | validation: format GUID
     - name: keywordResearchId | type: string | description: GUID of the keyword research the flow produced.  Available once `status` is `KEYWORD_RESEARCH` or later.  | validation: format GUID


```

### Examples

### Retrieve a content plan flow by ID
Polls a running flow. Here the flow has finished, so status is SUCCESS and the results are ready to read.

```curl
curl -X GET \
'https://www.wixapis.com/seo-content-plan-service/v1/content-plan-flows/d290f1ee-6c54-4b01-90e6-d701748f0851' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.seo.contentPlanFlows.getContentPlanFlow(contentPlanFlowId)
 Description: Retrieves a content plan flow.  While a flow is generating, poll this method with the `contentPlanFlowId` returned by Trigger Content Plan Generation Flow to follow the flow's progress.  Omit `contentPlanFlowId` to retrieve the site's most recent successful flow. This is useful for picking up a content plan that was generated in the site dashboard. A flow that's still running is never returned this way, and a site with no successful flow returns a not found error.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  contentPlanFlowId
 Method parameters: 
   param name: contentPlanFlowId | type: string | description: GUID of the content plan flow to retrieve.  Omit to retrieve the site's most recent successful flow. | required: true | validation: format GUID
 Return type: PROMISE<GetContentPlanFlowResponse>
  - name: contentPlanFlow | type: ContentPlanFlow | description: Retrieved content plan flow.  
     - name: _id | type: string | description: Content plan flow GUID.  | read-only: true | validation: format GUID
     - name: createdAt | type: string | description: Date and time the content plan flow was created.  | validation: maxLength 100
     - name: updatedAt | type: string | description: Date and time the content plan flow was updated.  | validation: maxLength 100
     - name: status | type: Status | description: Current status of the content plan flow.  The status advances on its own as generation progresses, except at `KEYWORD_RESEARCH`, where the flow waits for a call to Create Content Plan.  
         - enum:
         -     CREATED: The flow is created and the generation pipeline is starting.
         -     SITE_SUMMARY: The site's existing content is being summarized.
         -     KEYWORD_RESEARCH: Keyword research is complete and the flow is waiting. Call Create Content Plan to generate the blog post briefs and continue the flow.
         -     CONTENT_PLAN: Blog post briefs are being generated from the keyword research.
         -     SUCCESS: Generation is complete. Retrieve the results with List Blog Post Candidates and List Keyword Research Items.
         -     FAIL: Generation failed. Trigger a flow to try again.
         -     PENDING_REQUIREMENTS: The site is missing business information that keyword research requires. The flow resumes automatically once the information is added to the site.
         -     CANCELED: The flow was canceled and can't be resumed.
         -     SITE_ANALYSIS: The site's pages are being analyzed.
     - name: origin | type: string | description: What started the content plan flow. Flows started by an app are recorded as `AGENT`.  | validation: maxLength 100
     - name: summaryId | type: string | description: GUID of the site content summary the flow produced.  | validation: format GUID
     - name: keywordResearchId | type: string | description: GUID of the keyword research the flow produced.  Available once `status` is `KEYWORD_RESEARCH` or later.  | validation: format GUID


```

### Examples

### getContentPlanFlow
```javascript
import { contentPlanFlows } from '@wix/seo';

async function getContentPlanFlow(contentPlanFlowId) {
  const response = await contentPlanFlows.getContentPlanFlow(contentPlanFlowId);
};
```

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

async function myGetContentPlanFlowMethod(contentPlanFlowId) {
  const elevatedGetContentPlanFlow = auth.elevate(contentPlanFlows.getContentPlanFlow);
  const response = await elevatedGetContentPlanFlow(contentPlanFlowId);
}
```

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

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


async function getContentPlanFlow(contentPlanFlowId) {
  const response = await myWixClient.contentPlanFlows.getContentPlanFlow(contentPlanFlowId);
};
```

---