Page
In addition to an online storefront, Shopify stores come with a tool for creating basic HTML web pages. Store owners can create any number of pages to hold static content, such as an About us page, a Contact us page, or a page with customer testimonials.
These web pages are represented by the Page resource, and their HTML content is contained in the value of the body_html
property. The Page resource lets you retrieve, create, update, and delete web pages for a store.
Pages are meant to be used for long-term, static content that rarely changes. For creating content on a regular basis, use the Blog resource instead.
What you can do with Page
The Shopify API lets you do the following with the Page resource. More detailed versions of these general actions may be available:
- GET /admin/api/2019-10/pages.json Retrieves a list of pages
- GET /admin/api/2019-10/pages/count.json Retrieves a page count
- GET /admin/api/2019-10/pages/{page_id}.json Retrieves a single page by its ID
- POST /admin/api/2019-10/pages.json Create a new Page
- PUT /admin/api/2019-10/pages/{page_id}.json Updates a page
- DELETE /admin/api/2019-10/pages/{page_id}.json Deletes a page
Page properties
author |
The name of the person who created the page. |
body_html |
The text content of the page, complete with HTML markup. |
created_at
read-only |
The date and time (ISO 8601 format) when the page was created. |
handle |
A unique, human-friendly string for the page, generated automatically from its title. In online store themes, the Liquid templating language refers to a page by its handle. |
id
read-only |
The unique numeric identifier for the page. |
metafield |
Additional information attached to the Page object. It has the following properties:
For more information on attaching metadata to Shopify resources, see the Metafield resource. |
published_at |
The date and time (ISO 8601 format) when the page was published. Returns |
shop_id
read-only |
The ID of the shop to which the page belongs. |
template_suffix |
The suffix of the Liquid template being used. For example, if the value is |
title |
The page's title. |
updated_at
read-only |
The date and time (ISO 8601 format) when the page was last updated. |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
title
|
Retrieve pages with a given title. |
handle
|
Retrieve a page with a given handle. |
created_at_min
|
Show pages created after date (format: 2008-12-31). |
created_at_max
|
Show pages created before date (format: 2008-12-31). |
updated_at_min
|
Show pages last updated after date (format: 2008-12-31). |
updated_at_max
|
Show pages last updated before date (format: 2008-12-31). |
published_at_min
|
Show pages published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Show pages published before date (format: 2014-04-25T16:15:47-04:00). |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
published_status
|
Restrict results to pages with a given published status: (default:any )
|
Get all pages for a shop
GET /admin/api/2019-10/pages.json
View Response
HTTP/1.1 200 OK
{
"pages": [
{
"id": 108828309,
"title": "Sample Page",
"shop_id": 690933842,
"handle": "sample",
"body_html": "<p>this is a <strong>sample</strong> page.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/108828309"
},
{
"id": 169524623,
"title": "Store hours",
"shop_id": 690933842,
"handle": "store-hours",
"body_html": "<p>We never close.</p>",
"author": "Jobs",
"created_at": "2013-12-31T19:00:00-05:00",
"updated_at": "2013-12-31T19:00:00-05:00",
"published_at": "2014-02-01T19:00:00-05:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"
},
{
"id": 322471,
"title": "Support",
"shop_id": 690933842,
"handle": "support",
"body_html": "<p>Come in store for support.</p>",
"author": "Dennis",
"created_at": "2009-07-15T20:00:00-04:00",
"updated_at": "2009-07-16T20:00:00-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/322471"
},
{
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
]
}
Retrieve a list of all pages after the specified ID
GET /admin/api/2019-10/pages.json?since_id=108828309
View Response
HTTP/1.1 200 OK
{
"pages": [
{
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
},
{
"id": 169524623,
"title": "Store hours",
"shop_id": 690933842,
"handle": "store-hours",
"body_html": "<p>We never close.</p>",
"author": "Jobs",
"created_at": "2013-12-31T19:00:00-05:00",
"updated_at": "2013-12-31T19:00:00-05:00",
"published_at": "2014-02-01T19:00:00-05:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"
}
]
}
title
|
Count pages with a given title. |
created_at_min
|
Count pages created after date (format: 2008-12-31). |
created_at_max
|
Count pages created before date (format: 2008-12-31). |
updated_at_min
|
Count pages last updated after date (format: 2008-12-31). |
updated_at_max
|
Count pages last updated before date (format: 2008-12-31). |
published_at_min
|
Show pages published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Show pages published before date (format: 2014-04-25T16:15:47-04:00). |
published_status
|
Count pages with a given published status: (default:any )
|
Retrieve a count of all pages
GET /admin/api/2019-10/pages/count.json
View Response
HTTP/1.1 200 OK
{
"count": 4
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single page
GET /admin/api/2019-10/pages/131092082.json
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Create a page with HTML markup
POST /admin/api/2019-10/pages.json
{
"page": {
"title": "Warranty information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>"
}
}
View Response
HTTP/1.1 201 Created
{
"page": {
"id": 1025371369,
"title": "Warranty information",
"shop_id": 690933842,
"handle": "warranty-information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"author": "Shopify API",
"created_at": "2021-04-01T14:31:57-04:00",
"updated_at": "2021-04-01T14:31:57-04:00",
"published_at": "2021-04-01T14:31:57-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371369"
}
}
Create an unpublished page
POST /admin/api/2019-10/pages.json
{
"page": {
"title": "Warranty information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"published": false
}
}
View Response
HTTP/1.1 201 Created
{
"page": {
"id": 1025371370,
"title": "Warranty information",
"shop_id": 690933842,
"handle": "warranty-information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"author": "Shopify API",
"created_at": "2021-04-01T14:31:59-04:00",
"updated_at": "2021-04-01T14:31:59-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371370"
}
}
Creating a page without a title fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"title": [
"can't be blank"
]
}
}
Create a page with a metafield
POST /admin/api/2019-10/pages.json
{
"page": {
"title": "Warranty information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"metafields": [
{
"key": "new",
"value": "new value",
"value_type": "string",
"namespace": "global"
}
]
}
}
View Response
HTTP/1.1 201 Created
{
"page": {
"id": 1025371371,
"title": "Warranty information",
"shop_id": 690933842,
"handle": "warranty-information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"author": "Shopify API",
"created_at": "2021-04-01T14:32:02-04:00",
"updated_at": "2021-04-01T14:32:02-04:00",
"published_at": "2021-04-01T14:32:02-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371371"
}
}
Update the body HTML of an existing page
PUT /admin/api/2019-10/pages/131092082.json
{
"page": {
"id": 131092082,
"body_html": "<p>Returns accepted if we receive the items 14 days after purchase.</p>"
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>Returns accepted if we receive the items 14 days after purchase.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:04-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Update an existing page completely
PUT /admin/api/2019-10/pages/131092082.json
{
"page": {
"id": 131092082,
"body_html": "<p>Returns accepted if we receive the items <strong>14 days</strong> after purchase.</p>",
"author": "Christopher Gorski",
"title": "New warranty",
"handle": "new-warranty"
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "New warranty",
"shop_id": 690933842,
"handle": "new-warranty",
"body_html": "<p>Returns accepted if we receive the items <strong>14 days</strong> after purchase.</p>",
"author": "Christopher Gorski",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:05-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Show a hidden page
PUT /admin/api/2019-10/pages/131092082.json
{
"page": {
"id": 131092082,
"published": true
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:07-04:00",
"published_at": "2021-04-01T14:32:07-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Hide a published page
PUT /admin/api/2019-10/pages/131092082.json
{
"page": {
"id": 131092082,
"published": false
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:09-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Add a metafield to a page
PUT /admin/api/2019-10/pages/131092082.json
{
"page": {
"id": 131092082,
"metafields": [
{
"key": "new",
"value": "new value",
"value_type": "string",
"namespace": "global"
}
]
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:10-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
In addition to an online storefront, Shopify stores come with a tool for creating basic HTML web pages. Store owners can create any number of pages to hold static content, such as an About us page, a Contact us page, or a page with customer testimonials.
These web pages are represented by the Page resource, and their HTML content is contained in the value of the body_html
property. The Page resource lets you retrieve, create, update, and delete web pages for a store.
Pages are meant to be used for long-term, static content that rarely changes. For creating content on a regular basis, use the Blog resource instead.
What you can do with Page
The Shopify API lets you do the following with the Page resource. More detailed versions of these general actions may be available:
- GET /admin/api/2020-01/pages.json Retrieves a list of pages
- GET /admin/api/2020-01/pages/count.json Retrieves a page count
- GET /admin/api/2020-01/pages/{page_id}.json Retrieves a single page by its ID
- POST /admin/api/2020-01/pages.json Create a new Page
- PUT /admin/api/2020-01/pages/{page_id}.json Updates a page
- DELETE /admin/api/2020-01/pages/{page_id}.json Deletes a page
Page properties
author |
The name of the person who created the page. |
body_html |
The text content of the page, complete with HTML markup. |
created_at
read-only |
The date and time (ISO 8601 format) when the page was created. |
handle |
A unique, human-friendly string for the page, generated automatically from its title. In online store themes, the Liquid templating language refers to a page by its handle. |
id
read-only |
The unique numeric identifier for the page. |
metafield |
Additional information attached to the Page object. It has the following properties:
For more information on attaching metadata to Shopify resources, see the Metafield resource. |
published_at |
The date and time (ISO 8601 format) when the page was published. Returns |
shop_id
read-only |
The ID of the shop to which the page belongs. |
template_suffix |
The suffix of the Liquid template being used. For example, if the value is |
title |
The page's title. |
updated_at
read-only |
The date and time (ISO 8601 format) when the page was last updated. |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
title
|
Retrieve pages with a given title. |
handle
|
Retrieve a page with a given handle. |
created_at_min
|
Show pages created after date (format: 2008-12-31). |
created_at_max
|
Show pages created before date (format: 2008-12-31). |
updated_at_min
|
Show pages last updated after date (format: 2008-12-31). |
updated_at_max
|
Show pages last updated before date (format: 2008-12-31). |
published_at_min
|
Show pages published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Show pages published before date (format: 2014-04-25T16:15:47-04:00). |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
published_status
|
Restrict results to pages with a given published status: (default:any )
|
Get all pages for a shop
GET /admin/api/2020-01/pages.json
View Response
HTTP/1.1 200 OK
{
"pages": [
{
"id": 108828309,
"title": "Sample Page",
"shop_id": 690933842,
"handle": "sample",
"body_html": "<p>this is a <strong>sample</strong> page.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/108828309"
},
{
"id": 169524623,
"title": "Store hours",
"shop_id": 690933842,
"handle": "store-hours",
"body_html": "<p>We never close.</p>",
"author": "Jobs",
"created_at": "2013-12-31T19:00:00-05:00",
"updated_at": "2013-12-31T19:00:00-05:00",
"published_at": "2014-02-01T19:00:00-05:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"
},
{
"id": 322471,
"title": "Support",
"shop_id": 690933842,
"handle": "support",
"body_html": "<p>Come in store for support.</p>",
"author": "Dennis",
"created_at": "2009-07-15T20:00:00-04:00",
"updated_at": "2009-07-16T20:00:00-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/322471"
},
{
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
]
}
Retrieve a list of all pages after the specified ID
GET /admin/api/2020-01/pages.json?since_id=108828309
View Response
HTTP/1.1 200 OK
{
"pages": [
{
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
},
{
"id": 169524623,
"title": "Store hours",
"shop_id": 690933842,
"handle": "store-hours",
"body_html": "<p>We never close.</p>",
"author": "Jobs",
"created_at": "2013-12-31T19:00:00-05:00",
"updated_at": "2013-12-31T19:00:00-05:00",
"published_at": "2014-02-01T19:00:00-05:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"
}
]
}
title
|
Count pages with a given title. |
created_at_min
|
Count pages created after date (format: 2008-12-31). |
created_at_max
|
Count pages created before date (format: 2008-12-31). |
updated_at_min
|
Count pages last updated after date (format: 2008-12-31). |
updated_at_max
|
Count pages last updated before date (format: 2008-12-31). |
published_at_min
|
Show pages published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Show pages published before date (format: 2014-04-25T16:15:47-04:00). |
published_status
|
Count pages with a given published status: (default:any )
|
Retrieve a count of all pages
GET /admin/api/2020-01/pages/count.json
View Response
HTTP/1.1 200 OK
{
"count": 4
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single page
GET /admin/api/2020-01/pages/131092082.json
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Create a page with HTML markup
POST /admin/api/2020-01/pages.json
{
"page": {
"title": "Warranty information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>"
}
}
View Response
HTTP/1.1 201 Created
{
"page": {
"id": 1025371369,
"title": "Warranty information",
"shop_id": 690933842,
"handle": "warranty-information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"author": "Shopify API",
"created_at": "2021-04-01T14:31:57-04:00",
"updated_at": "2021-04-01T14:31:57-04:00",
"published_at": "2021-04-01T14:31:57-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371369"
}
}
Create an unpublished page
POST /admin/api/2020-01/pages.json
{
"page": {
"title": "Warranty information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"published": false
}
}
View Response
HTTP/1.1 201 Created
{
"page": {
"id": 1025371370,
"title": "Warranty information",
"shop_id": 690933842,
"handle": "warranty-information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"author": "Shopify API",
"created_at": "2021-04-01T14:31:59-04:00",
"updated_at": "2021-04-01T14:31:59-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371370"
}
}
Creating a page without a title fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"title": [
"can't be blank"
]
}
}
Create a page with a metafield
POST /admin/api/2020-01/pages.json
{
"page": {
"title": "Warranty information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"metafields": [
{
"key": "new",
"value": "new value",
"value_type": "string",
"namespace": "global"
}
]
}
}
View Response
HTTP/1.1 201 Created
{
"page": {
"id": 1025371371,
"title": "Warranty information",
"shop_id": 690933842,
"handle": "warranty-information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"author": "Shopify API",
"created_at": "2021-04-01T14:32:02-04:00",
"updated_at": "2021-04-01T14:32:02-04:00",
"published_at": "2021-04-01T14:32:02-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371371"
}
}
Update the body HTML of an existing page
PUT /admin/api/2020-01/pages/131092082.json
{
"page": {
"id": 131092082,
"body_html": "<p>Returns accepted if we receive the items 14 days after purchase.</p>"
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>Returns accepted if we receive the items 14 days after purchase.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:04-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Update an existing page completely
PUT /admin/api/2020-01/pages/131092082.json
{
"page": {
"id": 131092082,
"body_html": "<p>Returns accepted if we receive the items <strong>14 days</strong> after purchase.</p>",
"author": "Christopher Gorski",
"title": "New warranty",
"handle": "new-warranty"
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "New warranty",
"shop_id": 690933842,
"handle": "new-warranty",
"body_html": "<p>Returns accepted if we receive the items <strong>14 days</strong> after purchase.</p>",
"author": "Christopher Gorski",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:05-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Show a hidden page
PUT /admin/api/2020-01/pages/131092082.json
{
"page": {
"id": 131092082,
"published": true
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:07-04:00",
"published_at": "2021-04-01T14:32:07-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Hide a published page
PUT /admin/api/2020-01/pages/131092082.json
{
"page": {
"id": 131092082,
"published": false
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:09-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Add a metafield to a page
PUT /admin/api/2020-01/pages/131092082.json
{
"page": {
"id": 131092082,
"metafields": [
{
"key": "new",
"value": "new value",
"value_type": "string",
"namespace": "global"
}
]
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:10-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
In addition to an online storefront, Shopify stores come with a tool for creating basic HTML web pages. Store owners can create any number of pages to hold static content, such as an About us page, a Contact us page, or a page with customer testimonials.
These web pages are represented by the Page resource, and their HTML content is contained in the value of the body_html
property. The Page resource lets you retrieve, create, update, and delete web pages for a store.
Pages are meant to be used for long-term, static content that rarely changes. For creating content on a regular basis, use the Blog resource instead.
What you can do with Page
The Shopify API lets you do the following with the Page resource. More detailed versions of these general actions may be available:
- GET /admin/api/2020-04/pages.json Retrieves a list of pages
- GET /admin/api/2020-04/pages/count.json Retrieves a page count
- GET /admin/api/2020-04/pages/{page_id}.json Retrieves a single page by its ID
- POST /admin/api/2020-04/pages.json Create a new Page
- PUT /admin/api/2020-04/pages/{page_id}.json Updates a page
- DELETE /admin/api/2020-04/pages/{page_id}.json Deletes a page
Page properties
author |
The name of the person who created the page. |
body_html |
The text content of the page, complete with HTML markup. |
created_at
read-only |
The date and time (ISO 8601 format) when the page was created. |
handle |
A unique, human-friendly string for the page, generated automatically from its title. In online store themes, the Liquid templating language refers to a page by its handle. |
id
read-only |
The unique numeric identifier for the page. |
metafield |
Additional information attached to the Page object. It has the following properties:
For more information on attaching metadata to Shopify resources, see the Metafield resource. |
published_at |
The date and time (ISO 8601 format) when the page was published. Returns |
shop_id
read-only |
The ID of the shop to which the page belongs. |
template_suffix |
The suffix of the Liquid template being used. For example, if the value is |
title |
The page's title. |
updated_at
read-only |
The date and time (ISO 8601 format) when the page was last updated. |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
title
|
Retrieve pages with a given title. |
handle
|
Retrieve a page with a given handle. |
created_at_min
|
Show pages created after date (format: 2008-12-31). |
created_at_max
|
Show pages created before date (format: 2008-12-31). |
updated_at_min
|
Show pages last updated after date (format: 2008-12-31). |
updated_at_max
|
Show pages last updated before date (format: 2008-12-31). |
published_at_min
|
Show pages published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Show pages published before date (format: 2014-04-25T16:15:47-04:00). |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
published_status
|
Restrict results to pages with a given published status: (default:any )
|
Get all pages for a shop
GET /admin/api/2020-04/pages.json
View Response
HTTP/1.1 200 OK
{
"pages": [
{
"id": 108828309,
"title": "Sample Page",
"shop_id": 690933842,
"handle": "sample",
"body_html": "<p>this is a <strong>sample</strong> page.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/108828309"
},
{
"id": 169524623,
"title": "Store hours",
"shop_id": 690933842,
"handle": "store-hours",
"body_html": "<p>We never close.</p>",
"author": "Jobs",
"created_at": "2013-12-31T19:00:00-05:00",
"updated_at": "2013-12-31T19:00:00-05:00",
"published_at": "2014-02-01T19:00:00-05:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"
},
{
"id": 322471,
"title": "Support",
"shop_id": 690933842,
"handle": "support",
"body_html": "<p>Come in store for support.</p>",
"author": "Dennis",
"created_at": "2009-07-15T20:00:00-04:00",
"updated_at": "2009-07-16T20:00:00-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/322471"
},
{
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
]
}
Retrieve a list of all pages after the specified ID
GET /admin/api/2020-04/pages.json?since_id=108828309
View Response
HTTP/1.1 200 OK
{
"pages": [
{
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
},
{
"id": 169524623,
"title": "Store hours",
"shop_id": 690933842,
"handle": "store-hours",
"body_html": "<p>We never close.</p>",
"author": "Jobs",
"created_at": "2013-12-31T19:00:00-05:00",
"updated_at": "2013-12-31T19:00:00-05:00",
"published_at": "2014-02-01T19:00:00-05:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"
}
]
}
title
|
Count pages with a given title. |
created_at_min
|
Count pages created after date (format: 2008-12-31). |
created_at_max
|
Count pages created before date (format: 2008-12-31). |
updated_at_min
|
Count pages last updated after date (format: 2008-12-31). |
updated_at_max
|
Count pages last updated before date (format: 2008-12-31). |
published_at_min
|
Show pages published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Show pages published before date (format: 2014-04-25T16:15:47-04:00). |
published_status
|
Count pages with a given published status: (default:any )
|
Retrieve a count of all pages
GET /admin/api/2020-04/pages/count.json
View Response
HTTP/1.1 200 OK
{
"count": 4
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single page
GET /admin/api/2020-04/pages/131092082.json
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Create a page with HTML markup
POST /admin/api/2020-04/pages.json
{
"page": {
"title": "Warranty information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>"
}
}
View Response
HTTP/1.1 201 Created
{
"page": {
"id": 1025371369,
"title": "Warranty information",
"shop_id": 690933842,
"handle": "warranty-information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"author": "Shopify API",
"created_at": "2021-04-01T14:31:57-04:00",
"updated_at": "2021-04-01T14:31:57-04:00",
"published_at": "2021-04-01T14:31:57-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371369"
}
}
Create an unpublished page
POST /admin/api/2020-04/pages.json
{
"page": {
"title": "Warranty information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"published": false
}
}
View Response
HTTP/1.1 201 Created
{
"page": {
"id": 1025371370,
"title": "Warranty information",
"shop_id": 690933842,
"handle": "warranty-information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"author": "Shopify API",
"created_at": "2021-04-01T14:31:59-04:00",
"updated_at": "2021-04-01T14:31:59-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371370"
}
}
Creating a page without a title fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"title": [
"can't be blank"
]
}
}
Create a page with a metafield
POST /admin/api/2020-04/pages.json
{
"page": {
"title": "Warranty information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"metafields": [
{
"key": "new",
"value": "new value",
"value_type": "string",
"namespace": "global"
}
]
}
}
View Response
HTTP/1.1 201 Created
{
"page": {
"id": 1025371371,
"title": "Warranty information",
"shop_id": 690933842,
"handle": "warranty-information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"author": "Shopify API",
"created_at": "2021-04-01T14:32:02-04:00",
"updated_at": "2021-04-01T14:32:02-04:00",
"published_at": "2021-04-01T14:32:02-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371371"
}
}
Update the body HTML of an existing page
PUT /admin/api/2020-04/pages/131092082.json
{
"page": {
"id": 131092082,
"body_html": "<p>Returns accepted if we receive the items 14 days after purchase.</p>"
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>Returns accepted if we receive the items 14 days after purchase.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:04-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Update an existing page completely
PUT /admin/api/2020-04/pages/131092082.json
{
"page": {
"id": 131092082,
"body_html": "<p>Returns accepted if we receive the items <strong>14 days</strong> after purchase.</p>",
"author": "Christopher Gorski",
"title": "New warranty",
"handle": "new-warranty"
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "New warranty",
"shop_id": 690933842,
"handle": "new-warranty",
"body_html": "<p>Returns accepted if we receive the items <strong>14 days</strong> after purchase.</p>",
"author": "Christopher Gorski",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:05-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Show a hidden page
PUT /admin/api/2020-04/pages/131092082.json
{
"page": {
"id": 131092082,
"published": true
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:07-04:00",
"published_at": "2021-04-01T14:32:07-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Hide a published page
PUT /admin/api/2020-04/pages/131092082.json
{
"page": {
"id": 131092082,
"published": false
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:09-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Add a metafield to a page
PUT /admin/api/2020-04/pages/131092082.json
{
"page": {
"id": 131092082,
"metafields": [
{
"key": "new",
"value": "new value",
"value_type": "string",
"namespace": "global"
}
]
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:10-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
In addition to an online storefront, Shopify stores come with a tool for creating basic HTML web pages. Store owners can create any number of pages to hold static content, such as an About us page, a Contact us page, or a page with customer testimonials.
These web pages are represented by the Page resource, and their HTML content is contained in the value of the body_html
property. The Page resource lets you retrieve, create, update, and delete web pages for a store.
Pages are meant to be used for long-term, static content that rarely changes. For creating content on a regular basis, use the Blog resource instead.
What you can do with Page
The Shopify API lets you do the following with the Page resource. More detailed versions of these general actions may be available:
- GET /admin/api/2020-07/pages.json Retrieves a list of pages
- GET /admin/api/2020-07/pages/count.json Retrieves a page count
- GET /admin/api/2020-07/pages/{page_id}.json Retrieves a single page by its ID
- POST /admin/api/2020-07/pages.json Create a new Page
- PUT /admin/api/2020-07/pages/{page_id}.json Updates a page
- DELETE /admin/api/2020-07/pages/{page_id}.json Deletes a page
Page properties
author |
The name of the person who created the page. |
body_html |
The text content of the page, complete with HTML markup. |
created_at
read-only |
The date and time (ISO 8601 format) when the page was created. |
handle |
A unique, human-friendly string for the page, generated automatically from its title. In online store themes, the Liquid templating language refers to a page by its handle. |
id
read-only |
The unique numeric identifier for the page. |
metafield |
Additional information attached to the Page object. It has the following properties:
For more information on attaching metadata to Shopify resources, see the Metafield resource. |
published_at |
The date and time (ISO 8601 format) when the page was published. Returns |
shop_id
read-only |
The ID of the shop to which the page belongs. |
template_suffix |
The suffix of the Liquid template being used. For example, if the value is |
title |
The page's title. |
updated_at
read-only |
The date and time (ISO 8601 format) when the page was last updated. |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
title
|
Retrieve pages with a given title. |
handle
|
Retrieve a page with a given handle. |
created_at_min
|
Show pages created after date (format: 2008-12-31). |
created_at_max
|
Show pages created before date (format: 2008-12-31). |
updated_at_min
|
Show pages last updated after date (format: 2008-12-31). |
updated_at_max
|
Show pages last updated before date (format: 2008-12-31). |
published_at_min
|
Show pages published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Show pages published before date (format: 2014-04-25T16:15:47-04:00). |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
published_status
|
Restrict results to pages with a given published status: (default:any )
|
Get all pages for a shop
GET /admin/api/2020-07/pages.json
View Response
HTTP/1.1 200 OK
{
"pages": [
{
"id": 108828309,
"title": "Sample Page",
"shop_id": 690933842,
"handle": "sample",
"body_html": "<p>this is a <strong>sample</strong> page.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/108828309"
},
{
"id": 169524623,
"title": "Store hours",
"shop_id": 690933842,
"handle": "store-hours",
"body_html": "<p>We never close.</p>",
"author": "Jobs",
"created_at": "2013-12-31T19:00:00-05:00",
"updated_at": "2013-12-31T19:00:00-05:00",
"published_at": "2014-02-01T19:00:00-05:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"
},
{
"id": 322471,
"title": "Support",
"shop_id": 690933842,
"handle": "support",
"body_html": "<p>Come in store for support.</p>",
"author": "Dennis",
"created_at": "2009-07-15T20:00:00-04:00",
"updated_at": "2009-07-16T20:00:00-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/322471"
},
{
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
]
}
Retrieve a list of all pages after the specified ID
GET /admin/api/2020-07/pages.json?since_id=108828309
View Response
HTTP/1.1 200 OK
{
"pages": [
{
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
},
{
"id": 169524623,
"title": "Store hours",
"shop_id": 690933842,
"handle": "store-hours",
"body_html": "<p>We never close.</p>",
"author": "Jobs",
"created_at": "2013-12-31T19:00:00-05:00",
"updated_at": "2013-12-31T19:00:00-05:00",
"published_at": "2014-02-01T19:00:00-05:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"
}
]
}
title
|
Count pages with a given title. |
created_at_min
|
Count pages created after date (format: 2008-12-31). |
created_at_max
|
Count pages created before date (format: 2008-12-31). |
updated_at_min
|
Count pages last updated after date (format: 2008-12-31). |
updated_at_max
|
Count pages last updated before date (format: 2008-12-31). |
published_at_min
|
Show pages published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Show pages published before date (format: 2014-04-25T16:15:47-04:00). |
published_status
|
Count pages with a given published status: (default:any )
|
Retrieve a count of all pages
GET /admin/api/2020-07/pages/count.json
View Response
HTTP/1.1 200 OK
{
"count": 4
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single page
GET /admin/api/2020-07/pages/131092082.json
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Create a page with HTML markup
POST /admin/api/2020-07/pages.json
{
"page": {
"title": "Warranty information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>"
}
}
View Response
HTTP/1.1 201 Created
{
"page": {
"id": 1025371369,
"title": "Warranty information",
"shop_id": 690933842,
"handle": "warranty-information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"author": "Shopify API",
"created_at": "2021-04-01T14:31:57-04:00",
"updated_at": "2021-04-01T14:31:57-04:00",
"published_at": "2021-04-01T14:31:57-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371369"
}
}
Create an unpublished page
POST /admin/api/2020-07/pages.json
{
"page": {
"title": "Warranty information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"published": false
}
}
View Response
HTTP/1.1 201 Created
{
"page": {
"id": 1025371370,
"title": "Warranty information",
"shop_id": 690933842,
"handle": "warranty-information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"author": "Shopify API",
"created_at": "2021-04-01T14:31:59-04:00",
"updated_at": "2021-04-01T14:31:59-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371370"
}
}
Creating a page without a title fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"title": [
"can't be blank"
]
}
}
Create a page with a metafield
POST /admin/api/2020-07/pages.json
{
"page": {
"title": "Warranty information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"metafields": [
{
"key": "new",
"value": "new value",
"value_type": "string",
"namespace": "global"
}
]
}
}
View Response
HTTP/1.1 201 Created
{
"page": {
"id": 1025371371,
"title": "Warranty information",
"shop_id": 690933842,
"handle": "warranty-information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"author": "Shopify API",
"created_at": "2021-04-01T14:32:02-04:00",
"updated_at": "2021-04-01T14:32:02-04:00",
"published_at": "2021-04-01T14:32:02-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371371"
}
}
Update the body HTML of an existing page
PUT /admin/api/2020-07/pages/131092082.json
{
"page": {
"id": 131092082,
"body_html": "<p>Returns accepted if we receive the items 14 days after purchase.</p>"
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>Returns accepted if we receive the items 14 days after purchase.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:04-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Update an existing page completely
PUT /admin/api/2020-07/pages/131092082.json
{
"page": {
"id": 131092082,
"body_html": "<p>Returns accepted if we receive the items <strong>14 days</strong> after purchase.</p>",
"author": "Christopher Gorski",
"title": "New warranty",
"handle": "new-warranty"
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "New warranty",
"shop_id": 690933842,
"handle": "new-warranty",
"body_html": "<p>Returns accepted if we receive the items <strong>14 days</strong> after purchase.</p>",
"author": "Christopher Gorski",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:05-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Show a hidden page
PUT /admin/api/2020-07/pages/131092082.json
{
"page": {
"id": 131092082,
"published": true
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:07-04:00",
"published_at": "2021-04-01T14:32:07-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Hide a published page
PUT /admin/api/2020-07/pages/131092082.json
{
"page": {
"id": 131092082,
"published": false
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:09-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Add a metafield to a page
PUT /admin/api/2020-07/pages/131092082.json
{
"page": {
"id": 131092082,
"metafields": [
{
"key": "new",
"value": "new value",
"value_type": "string",
"namespace": "global"
}
]
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:10-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
In addition to an online storefront, Shopify stores come with a tool for creating basic HTML web pages. Store owners can create any number of pages to hold static content, such as an About us page, a Contact us page, or a page with customer testimonials.
These web pages are represented by the Page resource, and their HTML content is contained in the value of the body_html
property. The Page resource lets you retrieve, create, update, and delete web pages for a store.
Pages are meant to be used for long-term, static content that rarely changes. For creating content on a regular basis, use the Blog resource instead.
What you can do with Page
The Shopify API lets you do the following with the Page resource. More detailed versions of these general actions may be available:
- GET /admin/api/2020-10/pages.json Retrieves a list of pages
- GET /admin/api/2020-10/pages/count.json Retrieves a page count
- GET /admin/api/2020-10/pages/{page_id}.json Retrieves a single page by its ID
- POST /admin/api/2020-10/pages.json Create a new Page
- PUT /admin/api/2020-10/pages/{page_id}.json Updates a page
- DELETE /admin/api/2020-10/pages/{page_id}.json Deletes a page
Page properties
author |
The name of the person who created the page. |
body_html |
The text content of the page, complete with HTML markup. |
created_at
read-only |
The date and time (ISO 8601 format) when the page was created. |
handle |
A unique, human-friendly string for the page, generated automatically from its title. In online store themes, the Liquid templating language refers to a page by its handle. |
id
read-only |
The unique numeric identifier for the page. |
metafield |
Additional information attached to the Page object. It has the following properties:
For more information on attaching metadata to Shopify resources, see the Metafield resource. |
published_at |
The date and time (ISO 8601 format) when the page was published. Returns |
shop_id
read-only |
The ID of the shop to which the page belongs. |
template_suffix |
The suffix of the Liquid template being used. For example, if the value is |
title |
The page's title. |
updated_at
read-only |
The date and time (ISO 8601 format) when the page was last updated. |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
title
|
Retrieve pages with a given title. |
handle
|
Retrieve a page with a given handle. |
created_at_min
|
Show pages created after date (format: 2008-12-31). |
created_at_max
|
Show pages created before date (format: 2008-12-31). |
updated_at_min
|
Show pages last updated after date (format: 2008-12-31). |
updated_at_max
|
Show pages last updated before date (format: 2008-12-31). |
published_at_min
|
Show pages published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Show pages published before date (format: 2014-04-25T16:15:47-04:00). |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
published_status
|
Restrict results to pages with a given published status: (default:any )
|
Get all pages for a shop
GET /admin/api/2020-10/pages.json
View Response
HTTP/1.1 200 OK
{
"pages": [
{
"id": 108828309,
"title": "Sample Page",
"shop_id": 690933842,
"handle": "sample",
"body_html": "<p>this is a <strong>sample</strong> page.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/108828309"
},
{
"id": 169524623,
"title": "Store hours",
"shop_id": 690933842,
"handle": "store-hours",
"body_html": "<p>We never close.</p>",
"author": "Jobs",
"created_at": "2013-12-31T19:00:00-05:00",
"updated_at": "2013-12-31T19:00:00-05:00",
"published_at": "2014-02-01T19:00:00-05:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"
},
{
"id": 322471,
"title": "Support",
"shop_id": 690933842,
"handle": "support",
"body_html": "<p>Come in store for support.</p>",
"author": "Dennis",
"created_at": "2009-07-15T20:00:00-04:00",
"updated_at": "2009-07-16T20:00:00-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/322471"
},
{
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
]
}
Retrieve a list of all pages after the specified ID
GET /admin/api/2020-10/pages.json?since_id=108828309
View Response
HTTP/1.1 200 OK
{
"pages": [
{
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
},
{
"id": 169524623,
"title": "Store hours",
"shop_id": 690933842,
"handle": "store-hours",
"body_html": "<p>We never close.</p>",
"author": "Jobs",
"created_at": "2013-12-31T19:00:00-05:00",
"updated_at": "2013-12-31T19:00:00-05:00",
"published_at": "2014-02-01T19:00:00-05:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/169524623"
}
]
}
title
|
Count pages with a given title. |
created_at_min
|
Count pages created after date (format: 2008-12-31). |
created_at_max
|
Count pages created before date (format: 2008-12-31). |
updated_at_min
|
Count pages last updated after date (format: 2008-12-31). |
updated_at_max
|
Count pages last updated before date (format: 2008-12-31). |
published_at_min
|
Show pages published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Show pages published before date (format: 2014-04-25T16:15:47-04:00). |
published_status
|
Count pages with a given published status: (default:any )
|
Retrieve a count of all pages
GET /admin/api/2020-10/pages/count.json
View Response
HTTP/1.1 200 OK
{
"count": 4
}
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
Retrieve a single page
GET /admin/api/2020-10/pages/131092082.json
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Create a page with HTML markup
POST /admin/api/2020-10/pages.json
{
"page": {
"title": "Warranty information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>"
}
}
View Response
HTTP/1.1 201 Created
{
"page": {
"id": 1025371369,
"title": "Warranty information",
"shop_id": 690933842,
"handle": "warranty-information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"author": "Shopify API",
"created_at": "2021-04-01T14:31:57-04:00",
"updated_at": "2021-04-01T14:31:57-04:00",
"published_at": "2021-04-01T14:31:57-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371369"
}
}
Create an unpublished page
POST /admin/api/2020-10/pages.json
{
"page": {
"title": "Warranty information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"published": false
}
}
View Response
HTTP/1.1 201 Created
{
"page": {
"id": 1025371370,
"title": "Warranty information",
"shop_id": 690933842,
"handle": "warranty-information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"author": "Shopify API",
"created_at": "2021-04-01T14:31:59-04:00",
"updated_at": "2021-04-01T14:31:59-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371370"
}
}
Creating a page without a title fails and returns an error
HTTP/1.1 422 Unprocessable Entity
{
"errors": {
"title": [
"can't be blank"
]
}
}
Create a page with a metafield
POST /admin/api/2020-10/pages.json
{
"page": {
"title": "Warranty information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"metafields": [
{
"key": "new",
"value": "new value",
"value_type": "string",
"namespace": "global"
}
]
}
}
View Response
HTTP/1.1 201 Created
{
"page": {
"id": 1025371371,
"title": "Warranty information",
"shop_id": 690933842,
"handle": "warranty-information",
"body_html": "<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>",
"author": "Shopify API",
"created_at": "2021-04-01T14:32:02-04:00",
"updated_at": "2021-04-01T14:32:02-04:00",
"published_at": "2021-04-01T14:32:02-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/1025371371"
}
}
Update the body HTML of an existing page
PUT /admin/api/2020-10/pages/131092082.json
{
"page": {
"id": 131092082,
"body_html": "<p>Returns accepted if we receive the items 14 days after purchase.</p>"
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>Returns accepted if we receive the items 14 days after purchase.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:04-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Update an existing page completely
PUT /admin/api/2020-10/pages/131092082.json
{
"page": {
"id": 131092082,
"body_html": "<p>Returns accepted if we receive the items <strong>14 days</strong> after purchase.</p>",
"author": "Christopher Gorski",
"title": "New warranty",
"handle": "new-warranty"
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "New warranty",
"shop_id": 690933842,
"handle": "new-warranty",
"body_html": "<p>Returns accepted if we receive the items <strong>14 days</strong> after purchase.</p>",
"author": "Christopher Gorski",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:05-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Show a hidden page
PUT /admin/api/2020-10/pages/131092082.json
{
"page": {
"id": 131092082,
"published": true
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:07-04:00",
"published_at": "2021-04-01T14:32:07-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Hide a published page
PUT /admin/api/2020-10/pages/131092082.json
{
"page": {
"id": 131092082,
"published": false
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:09-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
Add a metafield to a page
PUT /admin/api/2020-10/pages/131092082.json
{
"page": {
"id": 131092082,
"metafields": [
{
"key": "new",
"value": "new value",
"value_type": "string",
"namespace": "global"
}
]
}
}
View Response
HTTP/1.1 200 OK
{
"page": {
"id": 131092082,
"title": "Terms of Services",
"shop_id": 690933842,
"handle": "tos",
"body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2021-04-01T14:32:10-04:00",
"published_at": "2008-07-15T20:00:00-04:00",
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}
}
In addition to an online storefront, Shopify stores come with a tool for creating basic HTML web pages. Store owners can create any number of pages to hold static content, such as an About us page, a Contact us page, or a page with customer testimonials.
These web pages are represented by the Page resource, and their HTML content is contained in the value of the body_html
property. The Page resource lets you retrieve, create, update, and delete web pages for a store.
Pages are meant to be used for long-term, static content that rarely changes. For creating content on a regular basis, use the Blog resource instead.
What you can do with Page
The Shopify API lets you do the following with the Page resource. More detailed versions of these general actions may be available:
- GET /admin/api/2021-01/pages.json Retrieves a list of pages
- GET /admin/api/2021-01/pages/count.json Retrieves a page count
- GET /admin/api/2021-01/pages/{page_id}.json Retrieves a single page by its ID
- POST /admin/api/2021-01/pages.json Create a new Page
- PUT /admin/api/2021-01/pages/{page_id}.json Updates a page
- DELETE /admin/api/2021-01/pages/{page_id}.json Deletes a page
Page properties
author |
The name of the person who created the page. |
body_html |
The text content of the page, complete with HTML markup. |
created_at
read-only |
The date and time (ISO 8601 format) when the page was created. |
handle |
A unique, human-friendly string for the page, generated automatically from its title. In online store themes, the Liquid templating language refers to a page by its handle. |
id
read-only |
The unique numeric identifier for the page. |
metafield |
Additional information attached to the Page object. It has the following properties:
For more information on attaching metadata to Shopify resources, see the Metafield resource. |
published_at |
The date and time (ISO 8601 format) when the page was published. Returns |
shop_id
read-only |
The ID of the shop to which the page belongs. |
template_suffix |
The suffix of the Liquid template being used. For example, if the value is |
title |
The page's title. |
updated_at
read-only |
The date and time (ISO 8601 format) when the page was last updated. |
Endpoints
page
parameter will return an error. To learn more, see Making requests to paginated REST Admin API endpoints.
limit
|
The maximum number of results to show. (default:50 , maximum: 250 )
|
since_id
|
Restrict results to after the specified ID. |
title
|
Retrieve pages with a given title. |
handle
|
Retrieve a page with a given handle. |
created_at_min
|
Show pages created after date (format: 2008-12-31). |
created_at_max
|
Show pages created before date (format: 2008-12-31). |
updated_at_min
|
Show pages last updated after date (format: 2008-12-31). |
updated_at_max
|
Show pages last updated before date (format: 2008-12-31). |
published_at_min
|
Show pages published after date (format: 2014-04-25T16:15:47-04:00). |
published_at_max
|
Show pages published before date (format: 2014-04-25T16:15:47-04:00). |
fields
|
Show only certain fields, specified by a comma-separated list of field names. |
published_status
|
Restrict results to pages with a given published status: (default:any )
|
Get all pages for a shop
GET /admin/api/2021-01/pages.json
View Response
HTTP/1.1 200 OK
{
"pages": [
{
"id": 108828309,
"title": "Sample Page",
"shop_id": 690933842,
"handle": "sample",
"body_html": "<p>this is a <strong>sample</strong> page.</p>",
"author": "Dennis",
"created_at": "2008-07-15T20:00:00-04:00",
"updated_at": "2008-07-16T20:00:00-04:00",
"published_at": null,
"template_suffix": null,
"admin_graphql_api_id": "gid://shopify/OnlineStorePage/108828309"
},
{
"id": 169524623,
"title": "Store hours",
"shop_id": 690933842