> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> 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`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetDynamicContextMarkdown

# Package: dynamicSiteContext

# Namespace: DynamicContextService

# Method link: https://dev.wix.com/docs/api-reference/tools/dynamic-site-context/get-dynamic-context-markdown.md

## Permission Scopes:
Manage Context Tools: SCOPE.API-INFRA.CONTEXT-MANAGE

## Introduction

Retrieves the same aggregated context as `GetDynamicContext`, rendered as a
markdown report. The markdown is byte-identical to the output of the
`@wix/dynamic-context-enricher` package used by the Wix MCP.

---

## REST API

### Schema

```
 Method: getDynamicContextMarkdown
 Description: Retrieves the same aggregated context as `GetDynamicContext`, rendered as a markdown report. The markdown is byte-identical to the output of the `@wix/dynamic-context-enricher` package used by the Wix MCP.
 URL: https://www.wixapis.com/_api/dynamic-context/v1/dynamic-context/markdown
 Method: POST
 Method parameters:
   param name: businessData | type: BusinessDataOptions | description: Options for the opt-in business data section. Each entity kind is one read call to the owning business solution, run in parallel with the rest of the site enrichment and bounded by a per-site time budget.  
        - name: kinds | type: array<Kind> | description: Entity kinds to include. Empty means every supported kind whose owning app is installed on the site. Kinds whose app is not installed are omitted.  | validation: maxItems 20
             - enum:
             -     STORES_PRODUCTS: Wix Stores products (catalog V1 or V3, resolved per site).
             -     STORES_CATEGORIES: Wix Stores categories (V3) or collections (V1), each with its product count.
             -     ECOM_ORDERS: Wix eCommerce orders (Stores, Bookings, Events and other eCom checkouts).
             -     BOOKINGS_SERVICES: Wix Bookings services.
             -     EVENTS: Wix Events.
             -     BLOG_POSTS: Wix Blog posts.
             -     BLOG_CATEGORIES: Wix Blog categories, each with its post count.
             -     CONTACTS: Contacts. Counts only: contact data is never sampled.
             -     MEMBERS: Site members. Counts only: member data is never sampled.
             -     PRICING_PLANS: Wix Pricing Plans.
             -     CMS_COLLECTIONS: CMS data collections, each with its item count.
             -     FORMS: Wix Forms in the Forms app's namespace, with the submissions to the first 100 as `submissions`.
             -     PORTFOLIO_PROJECTS: Wix Portfolio projects.
             -     FAQ_QUESTIONS: Wix FAQ questions.
             -     DONATION_CAMPAIGNS: Wix Donations campaigns that are not archived.
             -     RENTALS: Wix Rentals: the Bookings services owned by the Rentals app.
             -     RESTAURANTS_MENU_ITEMS: Wix Restaurants menu items, with the number of menus as `menus`. Restaurant orders are `ECOM_ORDERS`.
        - name: detail | type: Detail | description: Level of detail. Defaults to `COUNTS`.  
             - enum:
             -     COUNTS: Totals and secondary counts only.
             -     SAMPLE: Totals plus up to `sample_size` sample items per kind.
        - name: sampleSize | type: integer | description: Number of sample items per kind in `SAMPLE` mode. Defaults to 5, maximum 20. Ignored in `COUNTS` mode.  | validation: minimum 1, maximum 20, format int32
        - name: bypassCache | type: boolean | description: Read every requested kind, and the payment providers, from their owning app instead of the short-lived cache. For a caller that has just written to the site, for example an agent that created content and now checks it is there. The fresh result replaces the cached one, so the next ordinary read is fresh too. Costs what a cache miss costs; the time budget still applies.  
   param name: includeAccountContext | type: includeAccountContext | description: Include the account header section (account name, GUID, status, dates).  
   param name: includePartnerContext | type: includePartnerContext | description: Include the partner-account section when the calling account owns a Partner Dashboard.  
   param name: query | type: CursorQuery    
     - name: cursorPaging | type: CursorPaging | description: Cursor paging options.  Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#cursor-paging).  
        - 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
    - ONE-OF: 
     - name: siteId | type: string | description: Filter results to a single site by its GUID (GUGUID format). When provided, the response contains at most one site.  | validation: maxLength 36, format GUID
     - name: siteName | type: string | description: Filter results to a single site by its display name (exact match). When provided, the response contains at most one site.  | validation: maxLength 500
 Return type: GetDynamicContextMarkdownResponse
  - name: markdown | type: string | description: The markdown report. Byte-identical to the `@wix/dynamic-context-enricher` renderer output.  | validation: maxLength 1000000


```

### Examples

### Get Dynamic Context Markdown
Retrieves one site's context, with live business data (totals and sample items), rendered as a markdown report

```curl
curl -X POST \
  'https://www.wixapis.com/_api/dynamic-context/v1/dynamic-context/markdown' \
  -H 'Authorization: <AUTH>' \
  -H 'Content-Type: application/json' \
  -d '{"siteId": "a1b2c3d4-5678-90ab-cdef-1234567890ab", "businessData": {"detail": "SAMPLE", "sampleSize": 2}}'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.dynamicContext.dynamicContext.getDynamicContextMarkdown(options)
 Description: Retrieves the same aggregated context as `GetDynamicContext`, rendered as a markdown report. The markdown is byte-identical to the output of the `@wix/dynamic-context-enricher` package used by the Wix MCP.
 Method parameters:
   param name: options | type: GetDynamicContextMarkdownOptions  none  
    - ONE-OF: 
     - name: siteId | type: string | description: Filter results to a single site by its GUID (GUGUID format). When provided, the response contains at most one site.  | validation: maxLength 36, format GUID
     - name: siteName | type: string | description: Filter results to a single site by its display name (exact match). When provided, the response contains at most one site.  | validation: maxLength 500
        - name: query | type: CursorQuery | description: Cursor-based pagination. Use `query.paging.limit` to control page size (default: 10, max: 100).  
           - ONE-OF: 
              - name: cursorPaging | type: CursorPaging | description: Cursor paging options.  Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language.md#cursor-paging).  
                 - 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: includePartnerContext | type: boolean | description: Include the partner-account section when the calling account owns a Partner Dashboard.  
        - name: includeAccountContext | type: boolean | description: Include the account header section (account name, GUID, status, dates).  
        - name: businessData | type: BusinessDataOptions | description: Opt in to the `### Business data` section: live entity counts, and optionally sample items, from the business solutions installed on the site. Requires `site_id` or `site_name`; see `GetDynamicContextRequest.business_data`.  
           - name: kinds | type: array<Kind> | description: Entity kinds to include. Empty means every supported kind whose owning app is installed on the site. Kinds whose app is not installed are omitted.  | validation: maxItems 20
                 - enum:
                 -     STORES_PRODUCTS: Wix Stores products (catalog V1 or V3, resolved per site).
                 -     STORES_CATEGORIES: Wix Stores categories (V3) or collections (V1), each with its product count.
                 -     ECOM_ORDERS: Wix eCommerce orders (Stores, Bookings, Events and other eCom checkouts).
                 -     BOOKINGS_SERVICES: Wix Bookings services.
                 -     EVENTS: Wix Events.
                 -     BLOG_POSTS: Wix Blog posts.
                 -     BLOG_CATEGORIES: Wix Blog categories, each with its post count.
                 -     CONTACTS: Contacts. Counts only: contact data is never sampled.
                 -     MEMBERS: Site members. Counts only: member data is never sampled.
                 -     PRICING_PLANS: Wix Pricing Plans.
                 -     CMS_COLLECTIONS: CMS data collections, each with its item count.
                 -     FORMS: Wix Forms in the Forms app's namespace, with the submissions to the first 100 as `submissions`.
                 -     PORTFOLIO_PROJECTS: Wix Portfolio projects.
                 -     FAQ_QUESTIONS: Wix FAQ questions.
                 -     DONATION_CAMPAIGNS: Wix Donations campaigns that are not archived.
                 -     RENTALS: Wix Rentals: the Bookings services owned by the Rentals app.
                 -     RESTAURANTS_MENU_ITEMS: Wix Restaurants menu items, with the number of menus as `menus`. Restaurant orders are `ECOM_ORDERS`.
           - name: detail | type: Detail | description: Level of detail. Defaults to `COUNTS`.  
                 - enum:
                 -     COUNTS: Totals and secondary counts only.
                 -     SAMPLE: Totals plus up to `sample_size` sample items per kind.
           - name: sampleSize | type: integer | description: Number of sample items per kind in `SAMPLE` mode. Defaults to 5, maximum 20. Ignored in `COUNTS` mode.  | validation: minimum 1, maximum 20, format int32
           - name: bypassCache | type: boolean | description: Read every requested kind, and the payment providers, from their owning app instead of the short-lived cache. For a caller that has just written to the site, for example an agent that created content and now checks it is there. The fresh result replaces the cached one, so the next ordinary read is fresh too. Costs what a cache miss costs; the time budget still applies.  
 Return type: PROMISE<GetDynamicContextMarkdownResponse>
  - name: markdown | type: string | description: The markdown report. Byte-identical to the `@wix/dynamic-context-enricher` renderer output.  | validation: maxLength 1000000


```

### Examples

### getDynamicContextMarkdown
```javascript
import { dynamicContext } from '@wix/dynamic-context';

async function getDynamicContextMarkdown(options) {
  const response = await dynamicContext.getDynamicContextMarkdown(options);
};
```

### getDynamicContextMarkdown (with elevated permissions)
```javascript
import { dynamicContext } from '@wix/dynamic-context';
import { auth } from '@wix/essentials';

async function myGetDynamicContextMarkdownMethod(options) {
  const elevatedGetDynamicContextMarkdown = auth.elevate(dynamicContext.getDynamicContextMarkdown);
  const response = await elevatedGetDynamicContextMarkdown(options);
}
```

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

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


async function getDynamicContextMarkdown(options) {
  const response = await myWixClient.dynamicContext.getDynamicContextMarkdown(options);
};
```

---