> 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

## Resource: Sample Flows

## Article: Sample Flows

## Article Link: https://dev.wix.com/docs/api-reference/business-management/online-programs/sections/sample-flows.md

## Article Content:

# Program Sections API: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. It provides a useful starting point as you plan your implementation.

## Add a section to a program

Use this flow when you want to build or expand the structure of an existing online program.

To add a section to a program:

1. Create or identify the target program.
2. Call [Create Section](https://dev.wix.com/docs/api-reference/business-management/online-programs/sections/create-section.md) and specify the parent program ID in `section.programId`.
3. Treat `section.programId` as immutable after creation.
4. Set `section.description.title` to the section title.
5. Optionally set `delayInDays`.
6. Save the returned section ID for later retrieval, update, or move calls.

## Retrieve section outlines for a program

Use this flow when you need to display the section structure for a program dashboard or synchronize it into another system.

To retrieve section outlines for a program:

1. Call [List Sections](https://dev.wix.com/docs/api-reference/business-management/online-programs/sections/list-sections.md) with the target `programId` to retrieve all sections in program order.
2. Expect current section responses to return the section title.
3. Use the returned section IDs in later retrieve, update, move, or clone calls.

## Reorder sections in a program

Use this flow when you want to change the sequence in which sections appear in a program.

To reorder sections in a program:

1. Call [List Sections](https://dev.wix.com/docs/api-reference/business-management/online-programs/sections/list-sections.md) with the target `programId` to retrieve the current order of sections.
2. Identify the section to move and the section that should come immediately before it.
3. Call [Move Section](https://dev.wix.com/docs/api-reference/business-management/online-programs/sections/move-section.md) with the section ID and `afterSectionId`.
4. Leave `afterSectionId` empty if the section should become the first section in the program.
5. Use the returned section object to confirm the new ordering value.

## Filter and sort sections

Use this flow when you need more than the default program-order list, such as filtering by delay in days or sorting by creation date.

To filter and sort sections:

1. Call [Query Sections](https://dev.wix.com/docs/api-reference/business-management/online-programs/sections/query-sections.md).
2. Add a `query.filter` object for the program and any additional filters you need.
3. Add `query.sort` when you need a specific sort order, such as `ordering` or `createdDate`.
4. Set `query.cursorPaging.limit` to control page size.
5. Use the returned `pagingMetadata` to continue paging if more results are available.

## Clone section content

Use this flow when you want to reuse the structure and content of an existing section in the same program.

To clone section content:

1. Identify the section you want to reuse.
2. Call [Clone Section](https://dev.wix.com/docs/api-reference/business-management/online-programs/sections/clone-section.md) with that section's ID.
3. Save the returned cloned section ID.
4. Retrieve the cloned section later to get the current `totalSteps` value. Steps are cloned asynchronously after the clone call returns.

## Delete a section

Use this flow when a section should no longer exist in the public API.

To delete a section:

1. Identify the section to remove.
2. Call [Delete Section](https://dev.wix.com/docs/api-reference/business-management/online-programs/sections/delete-section.md) with that section's ID.
3. Treat the deletion as permanent from the public API perspective.
4. Stop using the deleted section ID in later get, list, query, or move calls.