Skip to main content
PATCH
/
api
/
v2
/
platform
/
cms_pages
/
{id}
Update a CMS Page
const options = {
  method: 'PATCH',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    cms_page: {
      title: 'About Us',
      type: 'Spree::Cms::Pages::StandardPage',
      meta_title: 'Learn More About Super-Shop',
      content: 'Lot\'s of text..',
      meta_description: 'Learn more about us on this page here...',
      visible: true,
      slug: 'about-us',
      locale: 'en-US'
    }
  })
};

fetch('http://{defaultHost}/api/v2/platform/cms_pages/{id}', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "data": {
    "id": "8",
    "type": "cms_page",
    "attributes": {
      "title": "My Super Page",
      "meta_title": null,
      "content": null,
      "meta_description": null,
      "visible": true,
      "slug": "cumque-excepturi-nisi-cupiditate-dolore",
      "type": "Spree::Cms::Pages::StandardPage",
      "locale": "en",
      "deleted_at": null,
      "created_at": "2022-11-08T19:34:02.188Z",
      "updated_at": "2022-11-08T19:34:02.420Z"
    },
    "relationships": {
      "cms_sections": {
        "data": []
      }
    }
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Query Parameters

include
string

Select which associated resources you would like to fetch, see: https://jsonapi.org/format/#fetching-includes

Body

application/json
cms_page
object
required

Response

Record updated

data
object
required