Backend API
Create a new content page.
Arguments
idobjectIdrequired
Unique identifier for the page.
slugstringauto
Slug identifier of the page. Defaults to a slug-formatted version of the title.
titlestringrequired
Title of the page.
contentstring
HTML or text content of the page.
publishedboolean
Indicates whether the page is published and should be displayed in the storefront.
date_publisheddate
Date the page was published. May be used to indicate the publish date in the storefront, or to delay publishing until a future date.
meta_titlestring
Title used for SEO purposes, if different than the page title.
meta_descriptionstring
Description used for SEO purposes. Typically the storefront will use a number of characters from the page's content if this is not defined.
meta_keywordsstring
Keywords used for SEO purposes.
theme_templatestring
Template used to render this page in a storefront theme, if applicable.
POST/content/pages
const { swell } = require('swell-node');
swell.init('store-id', 'secret-key');
await swell.post('/content/pages', {
title: 'Example page'
});
Response
{
"id": "60f199509111e70000000022",
"title": "Example page",
"slug": "example-page",
"content": null,
"published": true,
"date_published": "2021-07-16T14:36:00.142Z",
"meta_title": null,
"meta_description": null,
"date_created": "2021-07-16T14:36:00.142Z",
"date_updated": "2021-07-16T14:36:00.142Z"
}