> This page is for Changelog.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.makeswift.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.makeswift.com/_mcp/server.

## Write a page's element tree from the REST API

The Create Page and Update Page endpoints now accept an optional `elements` field, so you can set a page's element tree when you create or update the page.

```bash
POST /v6/pages
PATCH /v6/pages/{pageIdOrPathname}
```

* **Create**: if you leave out `elements`, the page starts with an empty root.
* **Update**: if you send `elements`, it replaces the page's entire tree.
* **Tree shape**: the root node has `type` set to `./components/Root/index.js`, a `key` (a UUID that's unique within the tree), and `props`. This is the same shape that `include=elements` returns on Get Page.
* **Responses**: Create Page and Update Page return `elements: null`. To read the tree after a write, call Get Page with `include=elements`.

### Error response changes

* A pathname that's invalid or already in use now returns `400` instead of `409`. A `400` is also returned for an invalid element tree.
* Create Page returns `404` if the site doesn't exist. Update Page returns `404` if the page or its site doesn't exist.

> **Note**
>
> The `elements` field is in beta and may change. Requests that send it return `403` until the feature is enabled for your site or workspace. To opt in, contact support: [support@makeswift.com](mailto:support@makeswift.com).

For details, see [Create Page](/developer/api-reference/rest/pages/create-page) and [Update Page](/developer/api-reference/rest/pages/update-page).