> 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

# ListStaticPages

# Package: richContent

# Namespace: RicosSiteContext

# Method link: https://dev.wix.com/docs/api-reference/assets/rich-content/site-context-v1/list-static-pages.md

## Permission Scopes:
Read Site Context for Rich Content: SCOPE.DC-RICOS.READ-SITE-CONTEXT

## Introduction

Lists the static pages of the current site, sorted by title, with cursor paging.

Returned pages:
+ The home page.
+ Pages that no Wix app manages.
+ Pages of Wix apps with these page intents: `shopping_cart`, `wix-referrals-refer-friend`, `Event List`, `Schedule`, `blog`, `all_members`, `groups`, `Challenges`, `wix_file_share_page`, `Menus`, `bookings_list`, `menu-orders-page-48605ac5-53fc-49b4-96b2-87f7636f5ce0` and `Loyalty`.

Other pages of Wix apps aren't returned. Pages aren't filtered by whether they're hidden, password-protected or restricted to site members.

To retrieve the next page of results, specify `pagingMetadata.cursors.next` from the previous response in `paging.cursor`.

---

## REST API

### Schema

```
 Method: listStaticPages
 Description: Lists the static pages of the current site, sorted by title, with cursor paging.  Returned pages: + The home page. + Pages that no Wix app manages. + Pages of Wix apps with these page intents: `shopping_cart`, `wix-referrals-refer-friend`, `Event List`, `Schedule`, `blog`, `all_members`, `groups`, `Challenges`, `wix_file_share_page`, `Menus`, `bookings_list`, `menu-orders-page-48605ac5-53fc-49b4-96b2-87f7636f5ce0` and `Loyalty`.  Other pages of Wix apps aren't returned. Pages aren't filtered by whether they're hidden, password-protected or restricted to site members.  To retrieve the next page of results, specify `pagingMetadata.cursors.next` from the previous response in `paging.cursor`.
 URL: https://www.wixapis.com/ricos/v1/site-context/static-pages/list
 Method: POST
 Method parameters:
   param name: paging | type: CursorPaging | description: Cursor-based pagination parameters for listing requests.  
        - name: limit | type: integer | description: Number of items to load per page.  | validation: minimum 0, maximum 100, format int32
        - name: cursor | type: string | description: Cursor token for pagination. Use the cursor from the previous response to get the next page of results.  | validation: maxLength 16000
 Return type: ListStaticPagesResponse
  - name: items | type: array<SitePage> | description: Static pages of the site.  
     - name: id | type: string | description: Page GUID of a static page or a dynamic page. For an item page, this is an opaque key that identifies the item page. It isn't a page GUID or a collection item GUID, so don't specify it as `pageId` in [List Dynamic Item Pages](https://dev.wix.com/docs/api-reference/assets/rich-content/site-context-v1/list-dynamic-item-pages.md), and don't parse it.  | validation: maxLength 300
     - name: title | type: string | description: Page title. For an item page, the name of the item. Empty if the item has no name.  | validation: maxLength 1000
     - name: path | type: string | description: Path of the page within the site. Store `path`, not `url`, as the link target, because it doesn't depend on the site's domain.  Always starts with `/`. For example: + Static page: includes the paths of the parent pages. For example, `/about/team`. + Dynamic page: the path shared by its item pages. For example, `/items`. + Item page: the dynamic page's path followed by the item's path. For example, `/items/first-item`.  | validation: maxLength 2000
     - name: url | type: string | description: Full URL of the page: the site's base URL followed by `path`. Use it to display or preview the link, but don't store it.  | validation: maxLength 4000
     - name: hasItemPages | type: boolean | description: Whether the dynamic page is the template of the item pages, as opposed to the page that lists the items. Returned only for dynamic pages. `false` is also returned for a dynamic page that has no item pages. If the site isn't published, item pages aren't available yet.  
  - name: published | type: boolean | description: Whether the site is published. If `false`, page URLs can't be reached by visitors yet.  
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata. To retrieve the next page of results, specify `cursors.next` in `paging.cursor`.  
     - name: count | type: integer | description: Number of items returned in the current response.  | validation: format int32
     - name: cursors | type: Cursors | description: Navigation cursors for moving between result pages.  
        - name: next | type: string | description: Cursor for retrieving the next page of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor for retrieving the previous page of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: SITE_CONTEXT_INVALID_CURSOR | Description: The paging cursor is invalid or expired. Start again without a cursor.


```

### Examples

### List static pages
Retrieves the static pages of the site and paginates through the results

```curl
curl -X POST \
'https://www.wixapis.com/ricos/v1/site-context/static-pages/list' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "paging": {
    "limit": 2
  }
}'


{
  "items": [
    {
      "id": "c1dmp",
      "title": "About",
      "path": "/about",
      "url": "https://username.wixsite.com/mysite/about"
    },
    {
      "id": "tuckg",
      "title": "Home",
      "path": "/home",
      "url": "https://username.wixsite.com/mysite/home"
    }
  ],
  "published": true,
  "pagingMetadata": {
    "count": 2,
    "cursors": {
      "next": "<NEXT_CURSOR>"
    },
    "hasNext": true
  }
}


curl -X POST \
'https://www.wixapis.com/ricos/v1/site-context/static-pages/list' \
-H 'Authorization: <AUTH>' \
-H 'Content-Type: application/json' \
-d '{
  "paging": {
    "limit": 2,
    "cursor": "<NEXT_CURSOR>"
  }
}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.richContent.ricosSiteContext.listStaticPages(options)
 Description: Lists the static pages of the current site, sorted by title, with cursor paging.  Returned pages: + The home page. + Pages that no Wix app manages. + Pages of Wix apps with these page intents: `shopping_cart`, `wix-referrals-refer-friend`, `Event List`, `Schedule`, `blog`, `all_members`, `groups`, `Challenges`, `wix_file_share_page`, `Menus`, `bookings_list`, `menu-orders-page-48605ac5-53fc-49b4-96b2-87f7636f5ce0` and `Loyalty`.  Other pages of Wix apps aren't returned. Pages aren't filtered by whether they're hidden, password-protected or restricted to site members.  To retrieve the next page of results, specify `pagingMetadata.cursors.next` from the previous response in `paging.cursor`.
 Method parameters:
   param name: options | type: ListStaticPagesOptions  none  
        - name: paging | type: CursorPaging | description: Cursor paging options.  Default: `paging.limit` is `50`.  
           - name: limit | type: integer | description: Number of items to load per page.  | validation: minimum 0, maximum 100, format int32
           - name: cursor | type: string | description: Cursor token for pagination. Use the cursor from the previous response to get the next page of results.  | validation: maxLength 16000
 Return type: PROMISE<ListStaticPagesResponse>
  - name: items | type: array<SitePage> | description: Static pages of the site.  
     - name: _id | type: string | description: Page GUID of a static page or a dynamic page. For an item page, this is an opaque key that identifies the item page. It isn't a page GUID or a collection item GUID, so don't specify it as `pageId` in [List Dynamic Item Pages](https://dev.wix.com/docs/api-reference/assets/rich-content/site-context-v1/list-dynamic-item-pages.md), and don't parse it.  | validation: maxLength 300
     - name: title | type: string | description: Page title. For an item page, the name of the item. Empty if the item has no name.  | validation: maxLength 1000
     - name: path | type: string | description: Path of the page within the site. Store `path`, not `url`, as the link target, because it doesn't depend on the site's domain.  Always starts with `/`. For example: + Static page: includes the paths of the parent pages. For example, `/about/team`. + Dynamic page: the path shared by its item pages. For example, `/items`. + Item page: the dynamic page's path followed by the item's path. For example, `/items/first-item`.  | validation: maxLength 2000
     - name: url | type: string | description: Full URL of the page: the site's base URL followed by `path`. Use it to display or preview the link, but don't store it.  | validation: maxLength 4000
     - name: hasItemPages | type: boolean | description: Whether the dynamic page is the template of the item pages, as opposed to the page that lists the items. Returned only for dynamic pages. `false` is also returned for a dynamic page that has no item pages. If the site isn't published, item pages aren't available yet.  
  - name: published | type: boolean | description: Whether the site is published. If `false`, page URLs can't be reached by visitors yet.  
  - name: pagingMetadata | type: CursorPagingMetadata | description: Paging metadata. To retrieve the next page of results, specify `cursors.next` in `paging.cursor`.  
     - name: count | type: integer | description: Number of items returned in the current response.  | validation: format int32
     - name: cursors | type: Cursors | description: Navigation cursors for moving between result pages.  
        - name: next | type: string | description: Cursor for retrieving the next page of results.  | validation: maxLength 16000
        - name: prev | type: string | description: Cursor for retrieving the previous page of results.  | validation: maxLength 16000
     - name: hasNext | type: boolean | description: Whether there are more pages to retrieve following the current page.  

 Possible Errors:
   HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: SITE_CONTEXT_INVALID_CURSOR | Description: The paging cursor is invalid or expired. Start again without a cursor.


```

### Examples

### List static pages
Retrieves the first 2 static pages of the site.

```javascript
import { ricosSiteContext } from "@wix/rich-content";

async function listStaticPages() {
  const response = await ricosSiteContext.listStaticPages({
    paging: {
      limit: 2,
    },
  });
}

/* Promise resolves to:
 * {
 *   "items": [
 *     {
 *       "_id": "c1dmp",
 *       "title": "About",
 *       "path": "/about",
 *       "url": "https://username.wixsite.com/mysite/about"
 *     },
 *     {
 *       "_id": "tuckg",
 *       "title": "Home",
 *       "path": "/home",
 *       "url": "https://username.wixsite.com/mysite/home"
 *     }
 *   ],
 *   "published": true,
 *   "pagingMetadata": {
 *     "count": 2,
 *     "cursors": {
 *       "next": "<NEXT_CURSOR>"
 *     },
 *     "hasNext": true
 *   }
 * }
 */

```

### listStaticPages (self-managed)
Self-managed 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 { ricosSiteContext } from '@wix/rich-content';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

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


async function listStaticPages(options) {
  const response = await myWixClient.ricosSiteContext.listStaticPages(options);
};
```

---