The REST Admin API is a legacy API as of October 1, 2024. All apps and integrations should be built with the GraphQL Admin API. For details and migration steps, visit our migration guide.

Requires content access scope.

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.

Was this section helpful?

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 themes, the Liquid templating language refers to a page by its handle.

id
read-only
->id
The unique numeric identifier for the page.

metafield
Additional information attached to the Page object. It has the following properties:

published_at
The date and time (ISO 8601 format) when the page was published. Returns null when the page is hidden.

shop_id
read-only
deprecated
The ID of the shop to which the page belongs.

template_suffix
The suffix of the template that is used to render the page. If the value is an empty string or null, then the default page template is used.

title
The title of the page.

updated_at
read-only
The date and time (ISO 8601 format) when the page was last updated.

admin_graphql_api_id
read-only
->id
The GraphQL GID of the page.

Was this section helpful?
{}The Page resource
{
  "author": "Lydia",
  "body_html": "Contact us at <a href='mailto:contact@example.com'>contact@example.com</a>.",
  "created_at": "2008-07-15T20:00:00-04:00",
  "handle": "contact-us",
  "id": 131092082,
  "metafield": {
    "key": "new",
    "value": "new value",
    "type": "single_line_text_field",
    "namespace": "global"
  },
  "published_at": "2014-07-16T20:00:00-04:00",
  "shop_id": 548380009,
  "template_suffix": "contact",
  "title": "Contact us",
  "updated_at": "2008-07-16T20:00:00-04:00",
  "admin_graphql_api_id": "gid://shopify/OnlineStorePage/131092082"
}

Was this section helpful?
Request body
page
Page resource
Was this section helpful?
post
/admin/api/2024-10/pages.json
Copy
curl -d '{"page":{"title":"Warranty information","body_html":"<h2>Warranty</h2>\n<p>Returns accepted if we receive items <strong>30 days after purchase</strong>.</p>"}}' \
-X POST "https://your-development-store.myshopify.com/admin/api/2024-10/pages.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"
{}Response
JSON
HTTP/1.1 201 Created
{
  "page": {
    "id": 1025371369,
    "title": "Warranty information",
    "shop_id": 548380009,
    "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": "2024-09-30T11:14:52-04:00",
    "updated_at": "2024-09-30T11:14:52-04:00",
    "published_at": "2024-09-30T11:14:52-04:00",
    "template_suffix": null,
    "admin_graphql_api_id": "gid://shopify/Page/1025371369"
  }
}

Retrieve a list of all pages. Note: This endpoint implements pagination by using links that are provided in the response header. To learn more, refer to Make paginated requests to the REST Admin API.

api_version
string
required

created_at_max
Show pages created before date (format: 2014-04-25T16:15:47-04:00).

created_at_min
Show pages created after date (format: 2014-04-25T16:15:47-04:00).

fields
Show only certain fields, specified by a comma-separated list of field names.

handle
Retrieve a page with a given handle.

limit
≤ 250
default 50
The maximum number of results to show.

published_at_max
Show pages published before date (format: 2014-04-25T16:15:47-04:00).

published_at_min
Show pages published after date (format: 2014-04-25T16:15:47-04:00).

published_status
default any
Restrict results to pages with a given published status:

since_id
Restrict results to after the specified ID.

title
Retrieve pages with a given title.

updated_at_max
Show pages last updated before date (format: 2014-04-25T16:15:47-04:00).

updated_at_min
Show pages last updated after date (format: 2014-04-25T16:15:47-04:00).

Was this section helpful?
Was this section helpful?
get
/admin/api/2024-10/pages.json
Copy
curl -X GET "https://your-development-store.myshopify.com/admin/api/2024-10/pages.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}Response
JSON
HTTP/1.1 200 OK
{
  "pages": [
    {
      "id": 108828309,
      "title": "Sample Page",
      "shop_id": 548380009,
      "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/Page/108828309"
    },
    {
      "id": 169524623,
      "title": "Store hours",
      "shop_id": 548380009,
      "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/Page/169524623"
    },
    {
      "id": 322471,
      "title": "Support",
      "shop_id": 548380009,
      "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/Page/322471"
    },
    {
      "id": 131092082,
      "title": "Terms of Services",
      "shop_id": 548380009,
      "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/Page/131092082"
    }
  ]
}

Retrieves a single page by its ID.

api_version
string
required

page_id
string
required

fields
Show only certain fields, specified by a comma-separated list of field names.

Was this section helpful?
Path parameters
pageid=131092082
string
required
Was this section helpful?
get
/admin/api/2024-10/pages/131092082.json
Copy
curl -X GET "https://your-development-store.myshopify.com/admin/api/2024-10/pages/131092082.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}Response
JSON
HTTP/1.1 200 OK
{
  "page": {
    "id": 131092082,
    "title": "Terms of Services",
    "shop_id": 548380009,
    "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/Page/131092082"
  }
}

Retrieves a page count.

api_version
string
required

created_at_max
Count pages created before date (format: 2014-04-25T16:15:47-04:00).

created_at_min
Count pages created 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_at_min
Show pages published after date (format: 2014-04-25T16:15:47-04:00).

published_status
default any
Count pages with a given published status:

title
Count pages with a given title.

updated_at_max
Count pages last updated before date (format: 2014-04-25T16:15:47-04:00).

updated_at_min
Count pages last updated after date (format: 2014-04-25T16:15:47-04:00).

Was this section helpful?
Was this section helpful?
get
/admin/api/2024-10/pages/count.json
Copy
curl -X GET "https://your-development-store.myshopify.com/admin/api/2024-10/pages/count.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}Response
JSON
HTTP/1.1 200 OK
{
  "count": 4
}

Updates a page

api_version
string
required

page_id
string
required

Was this section helpful?
Path parameters
pageid=131092082
string
required
Request body
page
Page resource
Was this section helpful?
put
/admin/api/2024-10/pages/131092082.json
Copy
curl -d '{"page":{"id":131092082,"metafields":[{"key":"new","value":"new value","type":"single_line_text_field","namespace":"global"}]}}' \
-X PUT "https://your-development-store.myshopify.com/admin/api/2024-10/pages/131092082.json" \
-H "X-Shopify-Access-Token: {access_token}" \
-H "Content-Type: application/json"
{}Response
JSON
HTTP/1.1 200 OK
{
  "page": {
    "shop_id": 548380009,
    "title": "Terms of Services",
    "handle": "tos",
    "body_html": "<p>We make <strong>perfect</strong> stuff, we don't need a warranty.</p>",
    "id": 131092082,
    "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/Page/131092082"
  }
}

Deletes a page.

api_version
string
required

page_id
string
required

Was this section helpful?
Path parameters
pageid=131092082
string
required
Was this section helpful?
del
/admin/api/2024-10/pages/131092082.json
Copy
curl -X DELETE "https://your-development-store.myshopify.com/admin/api/2024-10/pages/131092082.json" \
-H "X-Shopify-Access-Token: {access_token}"
{}Response
JSON
HTTP/1.1 200 OK
{}