# 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.
## Resource Properties ### Page * author: The name of the person who created the page. * Type: x-string * Example: "Lydia" * body_html: The text content of the page, complete with HTML markup. * Type: x-string * Example: "Contact us at contact@example.com." * created_at: The date and time (ISO 8601 format) when the page was created. * Type: x-string * Example: "2008-07-15T20:00:00-04:00" * 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. * Type: x-string * Example: "contact-us" * id: The unique numeric identifier for the page. * Type: x-string * Example: 131092082 * 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.
* Type: x-string * Example: {"key"=>"new", "value"=>"new value", "type"=>"single_line_text_field", "namespace"=>"global"} * published_at: The date and time (ISO 8601 format) when the page was published. Returnsnull
when the page is hidden.
* Type: x-string
* Example: "2014-07-16T20:00:00-04:00"
* shop_id: The ID of the shop to which the page belongs.
* Type: x-string
* Example: 548380009
* 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.
* Type: x-string
* Example: "contact"
* title: The title of the page.
* Type: x-string
* Example: "Contact us"
* updated_at: The date and time (ISO 8601 format) when the page was last updated.
* Type: x-string
* Example: "2008-07-16T20:00:00-04:00"
* admin_graphql_api_id: The GraphQL GID of the page.
* Type: x-string
* Example: "gid://shopify/OnlineStorePage/131092082"
## Retrieves a list of pages
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.
### Endpoint
/admin/api/#{api_version}/pages.json (GET)
### Parameters
* api_version (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: 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: 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).
### Responses
#### 200
Retrieves a list of pages
Examples:
##### Get all pages for a shop
Request:
```
GET /admin/api/unstable/pages.json
```
Response:
```
HTTP/1.1 200 OK
{"pages":[{"id":108828309,"title":"Sample Page","shop_id":548380009,"handle":"sample","body_html":"this is a sample page.
","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":"We never close.
","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":"Come in store for support.
","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":"We make perfect stuff, we don't need a warranty.
","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"}]} ``` ##### Retrieve a list of all pages after the specified ID Request: ``` GET /admin/api/unstable/pages.json ``` Response: ``` HTTP/1.1 200 OK {"pages":[{"id":131092082,"title":"Terms of Services","shop_id":548380009,"handle":"tos","body_html":"We make perfect stuff, we don't need a warranty.
","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"},{"id":169524623,"title":"Store hours","shop_id":548380009,"handle":"store-hours","body_html":"We never close.
","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"}]} ``` ## Creates a page Creates a page ### Endpoint /admin/api/#{api_version}/pages.json (POST) ### Parameters * api_version (required): ### Responses #### 201 Creates a page Examples: ##### Create a page with HTML markup Request: ``` POST /admin/api/unstable/pages.json {"page":{"title":"Warranty information","body_html":"Returns accepted if we receive items 30 days after purchase.
"}} ``` Response: ``` HTTP/1.1 201 Created {"page":{"id":1025371368,"title":"Warranty information","shop_id":548380009,"handle":"warranty-information","body_html":"Returns accepted if we receive items 30 days after purchase.
","author":"Shopify API","created_at":"2025-01-02T11:35:08-05:00","updated_at":"2025-01-02T11:35:08-05:00","published_at":"2025-01-02T11:35:08-05:00","template_suffix":null,"admin_graphql_api_id":"gid://shopify/Page/1025371368"}} ``` ##### Create a page with a metafield Request: ``` POST /admin/api/unstable/pages.json {"page":{"title":"Warranty information","body_html":"Returns accepted if we receive items 30 days after purchase.
","metafields":[{"key":"new","value":"new value","type":"single_line_text_field","namespace":"global"}]}} ``` Response: ``` HTTP/1.1 201 Created {"page":{"id":1025371371,"title":"Warranty information","shop_id":548380009,"handle":"warranty-information","body_html":"Returns accepted if we receive items 30 days after purchase.
","author":"Shopify API","created_at":"2025-01-02T11:35:18-05:00","updated_at":"2025-01-02T11:35:18-05:00","published_at":"2025-01-02T11:35:18-05:00","template_suffix":null,"admin_graphql_api_id":"gid://shopify/Page/1025371371"}} ``` ##### Create an unpublished page Request: ``` POST /admin/api/unstable/pages.json {"page":{"title":"Warranty information","body_html":"Returns accepted if we receive items 30 days after purchase.
","published":false}} ``` Response: ``` HTTP/1.1 201 Created {"page":{"id":1025371369,"title":"Warranty information","shop_id":548380009,"handle":"warranty-information","body_html":"Returns accepted if we receive items 30 days after purchase.
","author":"Shopify API","created_at":"2025-01-02T11:35:15-05:00","updated_at":"2025-01-02T11:35:15-05:00","published_at":null,"template_suffix":null,"admin_graphql_api_id":"gid://shopify/Page/1025371369"}} ``` #### 422 Creates a page Examples: ##### Creating a page without a title fails and returns an error Request: ``` POST /admin/api/unstable/pages.json {"page":{"body":"foobar"}} ``` Response: ``` HTTP/1.1 422 Unprocessable Entity {"errors":{"title":["can't be blank"]}} ``` ## Retrieves a page count Retrieves a page count. ### Endpoint /admin/api/#{api_version}/pages/count.json (GET) ### Parameters * api_version (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: 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). ### Responses #### 200 Retrieves a page count Examples: ##### Retrieve a count of all pages Request: ``` GET /admin/api/unstable/pages/count.json ``` Response: ``` HTTP/1.1 200 OK {"count":4} ``` ## Retrieves a single page by its ID Retrieves a single page by its ID. ### Endpoint /admin/api/#{api_version}/pages/{page_id}.json (GET) ### Parameters * api_version (required): * page_id (required): * fields: Show only certain fields, specified by a comma-separated list of field names. ### Responses #### 200 Retrieves a single page by its ID Examples: ##### Retrieve a single page Request: ``` GET /admin/api/unstable/pages/131092082.json ``` Response: ``` HTTP/1.1 200 OK {"page":{"id":131092082,"title":"Terms of Services","shop_id":548380009,"handle":"tos","body_html":"We make perfect stuff, we don't need a warranty.
","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"}} ``` ## Updates a page Updates a page ### Endpoint /admin/api/#{api_version}/pages/{page_id}.json (PUT) ### Parameters * api_version (required): * page_id (required): ### Responses #### 200 Updates a page Examples: ##### Add a metafield to a page Request: ``` PUT /admin/api/unstable/pages/131092082.json {"page":{"id":131092082,"metafields":[{"key":"new","value":"new value","type":"single_line_text_field","namespace":"global"}]}} ``` Response: ``` HTTP/1.1 200 OK {"page":{"shop_id":548380009,"title":"Terms of Services","handle":"tos","body_html":"We make perfect stuff, we don't need a warranty.
","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"}} ``` ##### Hide a published page Request: ``` PUT /admin/api/unstable/pages/131092082.json {"page":{"id":131092082,"published":false}} ``` Response: ``` HTTP/1.1 200 OK {"page":{"shop_id":548380009,"published_at":null,"title":"Terms of Services","handle":"tos","body_html":"We make perfect stuff, we don't need a warranty.
","id":131092082,"author":"Dennis","created_at":"2008-07-15T20:00:00-04:00","updated_at":"2025-01-02T11:35:08-05:00","template_suffix":null,"admin_graphql_api_id":"gid://shopify/Page/131092082"}} ``` ##### Show a hidden page Request: ``` PUT /admin/api/unstable/pages/131092082.json {"page":{"id":131092082,"published":true}} ``` Response: ``` HTTP/1.1 200 OK {"page":{"shop_id":548380009,"published_at":"2025-01-02T11:35:09-05:00","title":"Terms of Services","handle":"tos","body_html":"We make perfect stuff, we don't need a warranty.
","id":131092082,"author":"Dennis","created_at":"2008-07-15T20:00:00-04:00","updated_at":"2025-01-02T11:35:09-05:00","template_suffix":null,"admin_graphql_api_id":"gid://shopify/Page/131092082"}} ``` ##### Update an existing page completely Request: ``` PUT /admin/api/unstable/pages/131092082.json {"page":{"id":131092082,"body_html":"Returns accepted if we receive the items 14 days after purchase.
","author":"Christopher Gorski","title":"New warranty","handle":"new-warranty"}} ``` Response: ``` HTTP/1.1 200 OK {"page":{"shop_id":548380009,"author":"Christopher Gorski","body_html":"Returns accepted if we receive the items 14 days after purchase.
","handle":"new-warranty","title":"New warranty","id":131092082,"created_at":"2008-07-15T20:00:00-04:00","updated_at":"2025-01-02T11:35:20-05:00","published_at":"2008-07-15T20:00:00-04:00","template_suffix":null,"admin_graphql_api_id":"gid://shopify/Page/131092082"}} ``` ##### Update the body HTML of an existing page Request: ``` PUT /admin/api/unstable/pages/131092082.json {"page":{"id":131092082,"body_html":"Returns accepted if we receive the items 14 days after purchase.
"}} ``` Response: ``` HTTP/1.1 200 OK {"page":{"shop_id":548380009,"body_html":"Returns accepted if we receive the items 14 days after purchase.
","title":"Terms of Services","handle":"tos","id":131092082,"author":"Dennis","created_at":"2008-07-15T20:00:00-04:00","updated_at":"2025-01-02T11:35:13-05:00","published_at":"2008-07-15T20:00:00-04:00","template_suffix":null,"admin_graphql_api_id":"gid://shopify/Page/131092082"}} ``` ## Deletes a page Deletes a page. ### Endpoint /admin/api/#{api_version}/pages/{page_id}.json (DELETE) ### Parameters * api_version (required): * page_id (required): ### Responses #### 200 Deletes a page Examples: ##### Delete a page Request: ``` DELETE /admin/api/unstable/pages/131092082.json ``` Response: ``` HTTP/1.1 200 OK {} ```