Create a builder page
Endpoint: https://api.youcan.shop/pages/builder
Method: POST
Creates a landing page with the page builder. The content is validated against the page builder schema and built before it is saved. On a validation error, the page is not created.
Required Scopes
edit-pages
Parameters
| Param Name | Param Type | Description | Required |
|---|---|---|---|
name | string | Page name | yes |
slug | string | Page slug | no |
visibility | boolean | Page visibility. Default false, so you can check a preview first | no |
meta | object | title and description of the page | no |
settings | object | Page settings, keyed by setting name | no |
sections | array | Sections of the page, in order. See Page content | no |
Response
[201] Created
json
{
"id": "8b6d1a24-5c4e-4a5f-9d1e-0f2c3b4a5d6e",
"name": "Summer collection",
"slug": "summer-collection",
"visibility": "0",
"public_url": null,
"type": "landing",
"settings": {
"page-direction": "ltr",
"is-full-width": true
},
"sections": [
{
"id": "hero",
"name": "html-editor",
"label": "Hero",
"blocks": {
"parameters": { "htmlText": "<div class=\"kb-hero\"><h1>Summer collection</h1></div>" },
"style": { "css-content": ".kb-hero { padding: 48px; }" }
},
"children": []
}
],
"ignored": []
}ignored lists the paths of page settings that were not applied, such as settings.unknown-setting.
[422] Unprocessable Entity
Each error has the exact path of the value:
json
{
"errors": {
"sections.0.blocks.parameters.htmlText": ["may not contain scripts, event handlers or a javascript: or data: url"]
}
}