> 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/marketing/social-media/item-v1/sample-flows.md

## Article Content:

# Publisher 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.

## Create and publish a post

A site owner wants to publish a post to one of their connected social channels.

> **Prerequisite:** The site owner must connect the channel in the site's dashboard before you can publish to it. See [Connecting to your social media accounts](https://support.wix.com/en/article/social-media-marketing-connect-to-your-social-media-accounts).

To create and publish a post:

1. Call [List Accounts](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/account-v1/list-accounts.md) for the channel to retrieve the connected account's `id`.
1. Call [Get Feature Data](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/premium-feature-v1/get-feature-data.md) with `PUBLISH_POST` to confirm the site can publish and has remaining quota.
1. Call [Create Draft Item](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/item-v1/create-draft-item.md) with the post's channel, `type`, and content. The `type` and content must match a combination the channel supports. The response includes the draft's `id`.
1. Call [Publish Item By ID](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/item-v1/publish-item-by-id.md) with the draft's `id` to publish it immediately. The published post appears on the site's Social Media Marketing page in the dashboard.

## Schedule a post for a future date

A site owner wants to prepare a post now and have it published automatically at a later time.

To schedule a post:

1. Call [Create Draft Item](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/item-v1/create-draft-item.md) with the post's channel, `type`, and content. The response includes the draft's `id`.
1. Call [Publish Item By ID](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/item-v1/publish-item-by-id.md) with the draft's `id` and a `scheduledDate`. The post is published at that date with a status of `SCHEDULED`.

## Reschedule or cancel a scheduled post

A site owner wants to change the publish date of a scheduled post, or stop it from being published.

To reschedule or cancel a scheduled post:

1. Call [Query Items](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/item-v1/query-items.md) to find the scheduled post and get its `id` from the results.
1. To move the post to a different date, call [Reschedule Item](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/item-v1/reschedule-item.md) with the `id` and the new `scheduledDate`. To stop it from being published, call [Cancel Scheduled Item](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/item-v1/cancel-scheduled-item.md) with the `id`.

## Generate post content and publish it

A site owner wants to create a post from one of their site's assets, such as a product, without writing the content themselves.

To generate post content and publish it:

1. Call [Generate Post Data](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/generated-content-v1/generate-post-data.md) with the site assets to base the post on, the channels to generate for, or both. The response includes ready-to-use post content for each requested channel.
1. Call [Create Draft Item](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/item-v1/create-draft-item.md) with the generated content for the channel you want to post to. The response includes the draft's `id`.
1. Call [Publish Item By ID](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/item-v1/publish-item-by-id.md) with the draft's `id` to publish it, or include a `scheduledDate` to schedule it.

## Generate a caption for a post

A site owner wants to create a caption with AI to use in a post, rather than generate a full post.

To generate content and publish a post with it:

1. Call [Generate Text](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/generated-content-v1/generate-text.md) with a prompt describing the post to generate caption suggestions.
1. Call [Create Draft Item](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/item-v1/create-draft-item.md) with the generated caption as the post's content. The response includes the draft's `id`.
1. Call [Publish Item By ID](https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/item-v1/publish-item-by-id.md) with the draft's `id` to publish it, or include a `scheduledDate` to schedule it.