# Wix

Connect a Wix site through Wix's app installer to publish, schedule and edit its blog posts and to add ad pixels without touching the site's code.

A connected Wix site is a blog account with one blog. You create, schedule, edit and delete its Wix Blog posts with the same [Blogs API](https://pozy.ai/docs/commerce/blogs) calls you use for Shopify and WordPress, and you can install ad pixels on the site. Wix accounts are not social accounts: they never appear in `POST /v1/posts`, and they have no inbox or analytics.

## What you can do

| Job | Supported |
| --- | --- |
| Publish, schedule, edit and delete blog posts | Yes |
| Cover image, tags, excerpt, SEO title and description | Yes |
| Ad pixels (page views) | Yes, through the installed app |
| Categories, translations, Wix Stores products | No |
| Create, rename or delete the blog | No (`405`) |

| Property | Value |
| --- | --- |
| Platform id | `wix` |
| Connect | Approve the app on the site in Wix's installer |
| Blog id | Always `"1"` |
| Article ids | Wix GUIDs |
| Scheduling | Native: Wix publishes at `publishDate` |

## Before you start

The site needs the **Wix Blog** app, and the person connecting must be allowed to install apps on the site.

## Connect a site

```bash cURL
curl "https://api.pozy.ai/v1/connect/wix?profileId=6710c3a9e4b0d2f1a8c95e21&redirect_url=https://app.example.com/connected" \
  -H "Authorization: Bearer $POZY_API_KEY"
```
```ts Node
const res = await fetch("https://api.pozy.ai/v1/connect/wix?profileId=6710c3a9e4b0d2f1a8c95e21&redirect_url=https:%2F%2Fapp.example.com%2Fconnected", {
  headers: { Authorization: `Bearer ${process.env.POZY_API_KEY}` },
});
const data = await res.json();
if (!res.ok) throw new Error(data.error);
// Redirect the site owner to data.authUrl
```
```python Python
import os, requests

resp = requests.get(
    "https://api.pozy.ai/v1/connect/wix",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    params={"profileId": "6710c3a9e4b0d2f1a8c95e21", "redirect_url": "https://app.example.com/connected"},
)
auth_url = resp.json()["authUrl"]
```

The user picks a site in Wix's installer and approves the app. Wix sends them back, Pozy saves the account and redirects to your `redirect_url`. Connecting the same site to the same profile again refreshes the account.

Access renews on its own. Removing the app from the site in Wix disconnects the account.

## Publish a post

```bash cURL
curl -X POST https://api.pozy.ai/v1/accounts/6710c4c8e4b0d2f1a8c95e44/blogs/1/articles \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Our winter opening hours",
    "bodyHtml": "<h2>From 1 December</h2><p>We open at 10:00 on weekdays.</p>",
    "handle": "winter-hours",
    "excerpt": "New opening hours from 1 December.",
    "tags": ["news", "hours"],
    "image": { "url": "https://cdn.example.com/storefront-winter.jpg", "altText": "Shop front with snow" },
    "seo": { "title": "Winter opening hours", "description": "Our new hours from 1 December." },
    "publishDate": "2026-11-28T09:00:00Z"
  }'
```

How Wix treats each field:

| Field | Behaviour |
| --- | --- |
| `bodyHtml` | Converted to Wix rich content. Each top-level HTML element must stay under 30,000 characters. Images in the body are imported into the site's Media Manager |
| `title`, `excerpt`, `handle` | Up to 200, 500 and 100 characters |
| `tags` | Matched by name, created when missing, up to 30 per post |
| `author` | A Wix site member id. Without it Pozy uses the author of the site's latest post, or creates an author named after the site |
| `image` | Cover image, imported into the Media Manager. JPEG, PNG, WebP or GIF up to 10 MB, at most three redirects |
| `isPublished` | `false` keeps a draft and wins over a date. `true` publishes now |
| `publishDate` | A future date schedules the post in Wix itself, so it goes out even if your servers are down |

Edits to a published post go live straight away. Lists return `bodyHtml: null`, so get the article to read its body. `url` is the public address while the post is published, and `null` for drafts. Deletes are permanent and skip the Wix trash.

## Pixels

The installed app adds one script to the site that loads each installed tag's base code, so every tag records page views. Wix swaps pages without a reload, and Pozy reports those page views again for Meta, TikTok, Google, Pinterest and ChatGPT. LinkedIn and X count the first page of each visit. The script is registered with Wix as an advertising script, so on sites with Wix's cookie banner it runs only for visitors who accept advertising cookies. See [Site pixels](https://pozy.ai/docs/commerce/site-pixels).

## Errors

| Error | Cause | Fix |
| --- | --- | --- |
| `wix_install_failed` on the redirect | The installer did not return a valid install | Start again from a fresh `authUrl` |
| `wix_connection_failed` on the redirect | The site could not be read, often because Wix Blog is missing | Add Wix Blog and connect again |
| `400` on an article | A field is too long, more than 30 tags, `author` is not a member id, or an HTML element is over 30,000 characters | Fix the field or split the HTML |
| `400` on an image | The URL is unreachable, redirects too often, or the file is not a supported image | Use a direct public image URL |
| `403` | The app was removed from the site | Reconnect the site |
| `409 reconnect_required` on a pixel install | The site has not approved the permission to add scripts | Send the owner to `details.authUrl`, or to **Apps > Manage Apps** in Wix, then retry |
| `429` | Wix rate limited the request | Retry after `Retry-After` |

## Endpoints

| Endpoint | What it does |
| --- | --- |
| [`GET /v1/connect/wix`](https://pozy.ai/docs/api/getWixConnectUrl) | Get Wix site install URL |
| [`GET /v1/accounts/{accountId}/blogs`](https://pozy.ai/docs/api/listBlogs) | List blogs |
| [`GET /v1/accounts/{accountId}/blogs/{blogId}/articles`](https://pozy.ai/docs/api/listBlogArticles) | List blog articles |
| [`POST /v1/accounts/{accountId}/blogs/{blogId}/articles`](https://pozy.ai/docs/api/createBlogArticle) | Create a blog article |
| [`GET /v1/accounts/{accountId}/blogs/{blogId}/articles/{articleId}`](https://pozy.ai/docs/api/getBlogArticle) | Get a blog article |
| [`PATCH /v1/accounts/{accountId}/blogs/{blogId}/articles/{articleId}`](https://pozy.ai/docs/api/updateBlogArticle) | Update a blog article |
| [`DELETE /v1/accounts/{accountId}/blogs/{blogId}/articles/{articleId}`](https://pozy.ai/docs/api/deleteBlogArticle) | Delete a blog article |
